.page {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
}

/* لو المحتوى أطول من الشاشة (بوابة الروابط مثلاً) نبدأ من الأعلى بدل التوسيط،
   عشان العنوان والعجلة ما ينقصّون من فوق */
.page.overflowing {
  justify-content: flex-start;
}

.brand-header {
  display: flex;
  justify-content: center;
  margin-bottom: 6px;
}

.brand-header img {
  height: 34px;
  width: auto;
  max-width: 80%;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.7));
}

.page-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  text-align: center;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 4px;
  margin-bottom: 16px;
  text-align: center;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.85);
}

/* ===== العجلة ===== */
.wheel-wrap {
  position: relative;
  width: min(88vw, 350px);
  aspect-ratio: 1;
  margin: 6px auto 20px;
}

.wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: relative;
  border: 6px solid var(--milan-gold);
  box-shadow:
    0 0 0 3px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(216, 30, 44, 0.35),
    0 25px 60px rgba(0, 0, 0, 0.6);
  background:
    repeating-conic-gradient(from 0deg, var(--milan-gold) 0deg 1deg, transparent 1deg 45deg),
    conic-gradient(
      var(--milan-red) 0deg 45deg,
      var(--milan-black) 45deg 90deg,
      var(--milan-red) 90deg 135deg,
      var(--milan-black) 135deg 180deg,
      var(--milan-red) 180deg 225deg,
      var(--milan-black) 225deg 270deg,
      var(--milan-red) 270deg 315deg,
      var(--milan-black) 315deg 360deg
    );
  transition: transform 4.2s cubic-bezier(0.15, 0.65, 0.15, 1);
  will-change: transform;
}

/* الحاوية الدوّارة لكل قطعة (سبوك) — تحمل صورة الجائزة (لو موجودة) واسمها معاً */
.wheel-segment {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 64%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transform-origin: 0% 50%;
  pointer-events: none;
}

.wheel-segment-icon {
  object-fit: cover;
  border-radius: 8px;
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  background: rgba(0, 0, 0, 0.25);
}

.wheel-label {
  text-align: center;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.wheel-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 88px;
  height: 88px;
  border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(circle at 35% 30%, #1c1c1c, #000);
  border: 3px solid var(--milan-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.6), inset 0 0 10px rgba(216, 30, 44, 0.5);
  z-index: 3;
}

.wheel-hub img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wheel-pointer {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 24px solid var(--milan-gold);
  z-index: 4;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

.spin-btn {
  border: none;
  cursor: pointer;
  padding: 14px 46px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--milan-red), var(--milan-red-dark));
  box-shadow: 0 10px 25px rgba(216, 30, 44, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.spin-btn:active {
  transform: scale(0.96);
  box-shadow: 0 4px 12px rgba(216, 30, 44, 0.4);
}

.spin-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ===== نافذة نتيجة العجلة ===== */
.result-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.result-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.result-card {
  width: 100%;
  max-width: 320px;
  text-align: center;
  padding: 28px 22px 22px;
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(40, 40, 40, 0.55), rgba(8, 8, 8, 0.7));
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 25px 70px rgba(0, 0, 0, 0.55),
    0 0 50px rgba(212, 175, 55, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: translateY(14px) scale(0.96);
  transition: transform 0.25s ease;
}

.result-backdrop.show .result-card {
  transform: translateY(0) scale(1);
}

.result-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 35% 30%, #2a2a2a, #000);
  border: 2px solid var(--milan-gold);
  box-shadow: 0 0 18px rgba(212, 175, 55, 0.35);
}

.result-icon svg {
  width: 26px;
  height: 26px;
  fill: var(--milan-gold);
}

.result-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.result-title {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 16px;
}

/* ===== كود الجائزة ===== */
.result-code-row {
  margin-bottom: 16px;
}

.result-code-label {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.result-code-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 14px;
  padding: 10px 8px 10px 14px;
}

.result-code-text {
  font-family: "Courier New", monospace;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--milan-gold);
  direction: ltr;
  text-shadow: 0 0 16px rgba(212, 175, 55, 0.4);
}

.copy-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  background: rgba(212, 175, 55, 0.16);
  color: var(--milan-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease;
}

.copy-btn svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.copy-btn .icon-check {
  display: none;
}

.copy-btn.copied {
  background: rgba(76, 175, 80, 0.22);
  color: #4caf50;
}

.copy-btn.copied .icon-copy {
  display: none;
}

.copy-btn.copied .icon-check {
  display: block;
}

.copy-btn:active {
  transform: scale(0.9);
}

.result-detail {
  font-size: 14px;
  font-weight: 700;
  color: var(--milan-gold);
  margin-bottom: 16px;
}

.result-detail.muted {
  color: var(--text-dim);
  font-weight: 600;
}

.result-detail:empty {
  display: none;
}

/* ===== شرط التوثيق على تيك توك ===== */
.result-terms {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  text-align: right;
  background: rgba(216, 30, 44, 0.12);
  border: 1px solid rgba(216, 30, 44, 0.3);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 18px;
}

.result-terms svg {
  width: 16px;
  height: 16px;
  fill: var(--milan-red);
  flex-shrink: 0;
  margin-top: 1px;
}

.result-terms span {
  font-size: 11.5px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.8);
}

.result-ok-btn {
  width: 100%;
  border: none;
  cursor: pointer;
  padding: 13px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  color: #1a1400;
  border-radius: 13px;
  background: linear-gradient(135deg, #f0c84b, var(--milan-gold));
  box-shadow: 0 8px 22px rgba(212, 175, 55, 0.3);
}

.result-ok-btn:active {
  transform: scale(0.97);
}

/* ===== زر العجلة — حالة مقفلة ===== */
.spin-btn.locked {
  background: linear-gradient(135deg, #4a4a4a, #2a2a2a);
  color: rgba(255, 255, 255, 0.55);
  box-shadow: none;
}

/* ===== بوابة الروابط المطلوبة ===== */
.links-gate {
  width: 100%;
  max-width: 340px;
  text-align: center;
  margin-top: 14px;
}

.gate-text {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.85);
}

.ban-warning {
  font-size: 11px;
  font-weight: 700;
  color: #ffb3b3;
  background: rgba(216, 30, 44, 0.16);
  border: 1px solid rgba(216, 30, 44, 0.4);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 12px;
  line-height: 1.6;
}

.links-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 22vh;
  overflow-y: auto;
}

.link-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 14px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #f0c84b, var(--milan-gold));
  color: #1a1400;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(212, 175, 55, 0.3);
}

.link-btn.done {
  background: linear-gradient(135deg, #6fcf73, #4caf50);
  color: #0c2b0d;
}

.link-btn .check {
  font-size: 14px;
}

.fine-print {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fine-print p {
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--milan-gold);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
  text-align: right;
}

/* ===== نافذة "خطوة وحدة ناقصة" ===== */
.result-icon.warn {
  font-size: 26px;
  background: radial-gradient(circle at 35% 30%, #2a2a2a, #000);
}

.gate-modal-text {
  font-size: 13px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 18px;
}

/* ===== عداد الانتظار ===== */
.cooldown-box {
  text-align: center;
}

.cooldown-timer {
  font-family: "Courier New", monospace;
  font-size: 26px;
  font-weight: 800;
  color: var(--milan-gold);
  text-shadow: 0 0 16px rgba(212, 175, 55, 0.4);
  direction: ltr;
}
