.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-4);
  background: var(--bg-overlay);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--d-base) var(--ease-std);
}

.modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal__sheet {
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - var(--s-8));
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-raised);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(20px) scale(0.98);
  transition: transform var(--d-slow) var(--ease-spring);
}

.modal.is-open .modal__sheet { transform: none; }

.modal__sheet--lg { max-width: 720px; }
.modal__sheet--xl { max-width: 960px; }
.modal__sheet--blocking { border-color: var(--accent); }

.modal__head {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-5) var(--s-6) var(--s-3);
  border-bottom: 1px solid var(--line-soft);
}

.modal__title {
  flex: 1;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--t-xl);
  text-transform: uppercase;
  letter-spacing: var(--tr-snug);
}

.modal__close {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--ink-2);
  transition: background var(--d-fast) var(--ease-std), color var(--d-fast) var(--ease-std);
}
.modal__close:hover { background: var(--bg-3); color: var(--ink-1); }
.modal__close::before, .modal__close::after {
  content: ""; position: absolute;
  width: 14px; height: 1.5px;
  background: currentColor;
}
.modal__close::before { transform: rotate(45deg); }
.modal__close::after { transform: rotate(-45deg); }
.modal__close { position: relative; }

.modal__body {
  padding: var(--s-5) var(--s-6);
  overflow-y: auto;
  color: var(--ink-2);
  font-size: var(--t-sm);
  line-height: var(--lh-loose);
}
.modal__body > * + * { margin-top: var(--s-3); }

.modal__foot {
  display: flex; gap: var(--s-3); justify-content: flex-end;
  padding: var(--s-4) var(--s-6) var(--s-5);
  border-top: 1px solid var(--line-soft);
  background: var(--bg-inset);
}

.modal__foot--stack { flex-direction: column; }
.modal__foot--stack .btn { width: 100%; }

.modal--age {
  background: rgba(8, 9, 15, 0.92);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

.modal--age .modal__sheet {
  background: linear-gradient(180deg, var(--bg-1), var(--bg-0));
  border: 1px solid var(--line-strong);
}

.modal__age-mark {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 72px; height: 72px;
  background: var(--accent);
  color: var(--ink-on-accent);
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  margin-bottom: var(--s-4);
  box-shadow: var(--sh-glow);
}

.modal__legal {
  font-size: var(--t-xs);
  color: var(--ink-3);
  line-height: var(--lh-loose);
}
.modal__legal a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 720px) {
  .modal { padding: 0; align-items: flex-end; }
  .modal__sheet {
    max-width: none;
    width: 100%;
    max-height: 92vh;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    transform: translateY(100%);
  }
  .modal.is-open .modal__sheet { transform: none; }
  .modal__head { padding: var(--s-4) var(--s-5) var(--s-3); }
  .modal__body { padding: var(--s-4) var(--s-5); }
  .modal__foot { padding: var(--s-4) var(--s-5); flex-direction: column-reverse; }
  .modal__foot .btn { width: 100%; }
  .modal--age { align-items: center; padding: var(--s-4); }
  .modal--age .modal__sheet { border-radius: var(--r-xl); transform: translateY(20px) scale(0.98); }
  .modal--age.is-open .modal__sheet { transform: none; }
}
