/* نافذة تعليمات اللاعب — مستقل عن play.css */

html.play-instructions-open,
body.play-instructions-open {
  overflow: hidden;
  touch-action: none;
}

.play-instructions-fab {
  position: fixed;
  z-index: 300;
  inset-inline-end: max(12px, env(safe-area-inset-right, 0px));
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: linear-gradient(165deg, #ffffff 0%, #f1f5f9 100%);
  color: #0f172a;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow:
    0 4px 14px rgba(15, 23, 42, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: transform 0.18s var(--spring, cubic-bezier(0.16, 1, 0.3, 1)), box-shadow 0.18s ease;
}

.play-instructions-fab:hover {
  transform: translateY(-1px);
  box-shadow:
    0 8px 22px rgba(79, 70, 229, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.play-instructions-fab:focus-visible {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
}

.play-instructions-fab__ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(145deg, #6366f1, #4f46e5);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
}

.play-instructions-fab__txt {
  white-space: nowrap;
}

.play-instructions-overlay {
  position: fixed;
  inset: 0;
  z-index: 380;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px))
    max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}

.play-instructions-overlay[hidden] {
  display: none !important;
}

.play-instructions-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.play-instructions-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  max-height: min(88dvh, 640px);
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  background: #ffffff;
  color: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow:
    0 28px 64px -16px rgba(15, 23, 42, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  overflow: hidden;
  animation: playInstrIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes playInstrIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.play-instructions-dialog__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 12px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.play-instructions-dialog__title {
  font-size: 1.2rem;
  font-weight: 900;
  line-height: 1.3;
  margin: 0;
}

.play-instructions-dialog__close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 12px;
  background: rgba(241, 245, 249, 0.95);
  color: #475569;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.play-instructions-dialog__close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.play-instructions-dialog__close:focus-visible {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
}

.play-instructions-dialog__body {
  padding: 14px 18px 8px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  font-size: 0.92rem;
  line-height: 1.65;
}

.play-instructions-block {
  margin-bottom: 18px;
}

.play-instructions-block:last-child {
  margin-bottom: 4px;
}

.play-instructions-block__h {
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
  margin: 0 0 10px;
}

.play-instructions-list {
  margin: 0;
  padding: 0 1.1em 0 0;
  list-style: disc;
}

.play-instructions-list li {
  margin-bottom: 8px;
  color: #334155;
}

.play-instructions-list li:last-child {
  margin-bottom: 0;
}

.play-instructions-lede {
  margin: 0 0 12px;
  color: #64748b;
  font-size: 0.88rem;
}

.play-instructions-dl {
  margin: 0;
}

.play-instructions-dl__row {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.play-instructions-dl__row:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.play-instructions-dl dt {
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.play-instructions-dl dd {
  margin: 0;
  color: #475569;
  font-size: 0.9rem;
  line-height: 1.6;
}

.play-instructions-glyph {
  font-size: 1rem;
  line-height: 1;
}

.play-instructions-mono {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  color: #0d9488;
}

.play-instructions-dialog__foot {
  padding: 12px 18px 18px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.play-instructions-dialog__done {
  width: 100%;
  justify-content: center;
}

@media (max-width: 380px) {
  .play-instructions-fab__txt {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .play-instructions-fab {
    padding: 10px;
    border-radius: 50%;
  }
}
