:root {
  --mw-green: #23e06b;
  --mw-green-2: #19c45a;
  --mw-surface: #0e1411;
  --mw-text: #e6fff0;
  --mw-muted: #c7f5da;
  --mw-outline: rgba(35, 224, 107, 0.65);
  --mw-shadow: 0 12px 36px rgba(35, 224, 107, 0.20), 0 0 0 2px rgba(35, 224, 107, 0.20) inset;
}
.mw-legal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 100000;
  display: none;
  touch-action: none;
}
.mw-legal-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(820px, 94vw);
  max-height: 88vh;
  background: var(--mw-surface);
  color: var(--mw-text);
  border-radius: 16px;
  border: 2px solid var(--mw-green);
  box-shadow: var(--mw-shadow);
  z-index: 100001;
  display: none;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}
/* Switch to grid so the footer owns the bottom row reliably */
.mw-legal-content {
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  height: 100%;
  max-height: 88vh;
  gap: 12px;
  padding: 16px;
}
.mw-legal-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1.2;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(35, 224, 107, 0.25);
}
.mw-legal-heading h2 {
  margin: 0;
  font-weight: 800;
  font-size: clamp(1rem, 1.8vw + .7rem, 1.25rem);
  letter-spacing: .2px;
  text-align: center;
}
.mw-legal-icon { filter: drop-shadow(0 0 3px var(--mw-green)); }
.mw-legal-sub {
  background: rgba(35, 224, 107, 0.08);
  border: 1px solid var(--mw-outline);
  border-radius: 12px;
  padding: 10px 12px;
  text-align: center;
  margin: 0;
  color: var(--mw-text);
}
.mw-legal-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0;
}
.mw-legal-btn {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 999px;
  text-decoration: none;
  background: linear-gradient(180deg, var(--mw-green), var(--mw-green-2));
  color: #03250f;
  font-weight: 800;
  border: 1px solid var(--mw-green);
  box-shadow: 0 6px 16px rgba(35, 224, 107, 0.35);
  transition: transform .05s ease, box-shadow .2s ease;
  white-space: nowrap;
}
.mw-legal-btn:hover { transform: translateY(-1px); }
.mw-legal-btn:focus-visible { outline: 2px solid white; outline-offset: 2px; }
.mw-legal-btn.ghost {
  background: transparent;
  color: var(--mw-green);
  border-color: rgba(35, 224, 107, 0.7);
  box-shadow: none;
}
/* Scrollable body uses the flexible row */
.mw-legal-body {
  min-height: 0;  /* required for grid child scrolling */
  background: rgba(35, 224, 107, 0.06);
  border: 1px solid rgba(35, 224, 107, 0.4);
  border-radius: 12px;
  padding: 12px;
  color: var(--mw-muted);
  font-size: 0.95rem;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.mw-legal-body p { margin: 0 0 10px; }
.mw-legal-body p:last-child { margin-bottom: 0; }
/* Footer lives in the last grid row = true bottom of modal */
.mw-legal-footer {
  border-top: 1px solid rgba(35, 224, 107, 0.22);
  padding-top: 8px;
  display: flex;
  align-items: center;
}
.mw-legal-dismiss {
  width: 100%;
  background: rgba(35, 224, 107, 0.15);
  color: var(--mw-green);
  border: 1px solid rgba(35, 224, 107, 0.5);
  border-radius: 10px;
  padding: 12px 14px;
  font-weight: 700;
  cursor: pointer;
}
.mw-legal-dismiss:hover { background: rgba(35, 224, 107, 0.22); }
.mw-legal-close {
  position: absolute;
  right: 10px;
  top: 8px;
  background: transparent;
  border: none;
  color: var(--mw-green);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
}
.mw-legal-close:hover { background: rgba(35, 224, 107, 0.12); }
.mw-legal-close:focus-visible { outline: 2px solid var(--mw-green); outline-offset: 2px; }
body.mw-legal-noscroll { overflow: hidden !important; }
@media (prefers-reduced-motion: reduce) {
  .mw-legal-btn { transition: none; }
}
@media (max-width: 520px) {
  .mw-legal-btn { padding: 9px 12px; }
}
