/*
 * MimiKrew design system: the shared vocabulary of every page. Loaded after the page stylesheets and before
 * the site header, so these components win over older page rules of equal specificity.
 * Use the variables below instead of raw values; see docs/DESIGN-SYSTEM.md.
 */
:root {
  /* Colour */
  --color-bg: #02010a;
  --color-surface: #180632;
  --color-surface-sunken: #0c0619;
  --color-surface-raised: #24104a;
  --color-border: #6138a2;
  --color-border-subtle: #361a62;
  --color-text: #ffffff;
  --color-text-muted: #c9b8d3;
  --color-text-subtle: #9a85b4;
  --color-accent: #ffba00;
  --color-accent-hover: #ffd049;
  --color-accent-shadow: #8c6500;
  --color-on-accent: #180632;
  --color-violet: #b129ff;
  --color-danger: #ff5c77;
  --color-danger-surface: #2a0a19;
  --color-danger-text: #ffe2dc;
  --color-success: #5ee6a8;
  --color-success-surface: #08251b;
  --color-success-text: #d4f8e8;
  /* Space: 4px steps */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  /* Shape */
  --radius-sm: 8px;
  --radius-control: 10px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;
  --control-height: 48px;
  /* Type */
  --font-body: Poppins, ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --text-xs: 12px;
  --text-sm: 14px;
  --text-md: 16px;
  --text-lg: 20px;
}

/* Headings spread their words evenly over their lines: no word left alone on the last line. */
h1,
h2,
h3 {
  text-wrap: balance;
}

/* Buttons: .primary (main action, one per area), .secondary (outline), .quiet (text), .danger (irreversible). */
.primary,
.secondary,
.danger {
  min-height: var(--control-height);
  padding: 0 var(--space-5);
  border-radius: var(--radius-control);
  font-weight: 800;
  line-height: 1.2;
}
.secondary {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text);
}
.secondary:hover:not(:disabled) {
  border-color: var(--color-violet);
  background: var(--color-surface-raised);
}
.danger {
  background: #c0263f;
  border: 1px solid var(--color-danger);
  color: #fff;
}
.quiet {
  min-height: 0;
  padding: var(--space-2) var(--space-1);
  background: none;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
  transition: text-decoration-color 0.15s;
}
.quiet:hover:not(:disabled) {
  transform: none;
  color: var(--color-text);
  text-decoration-color: currentColor;
}
/* Disabled reads as unavailable, not as a darker colour. */
.primary:disabled,
.secondary:disabled,
.danger:disabled {
  opacity: 1;
  background: var(--color-surface-raised);
  border-color: var(--color-border-subtle);
  color: var(--color-text-subtle);
  box-shadow: none;
  transform: none;
  cursor: not-allowed;
}

/* A row of buttons: always spaced, wraps on small screens. */
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-4);
}
.actions > button,
.actions > a {
  margin: 0;
}
.actions:empty {
  display: none;
}

/* Notice: a message about what just happened. */
.notice {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-surface-sunken);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: 1.5;
}
.notice.error {
  border-color: #f98671;
  background: var(--color-danger-surface);
  color: var(--color-danger-text);
}
.notice.success {
  border-color: var(--color-success);
  background: var(--color-success-surface);
  color: var(--color-success-text);
}
.notice a {
  color: inherit;
  font-weight: 700;
  text-underline-offset: 3px;
}
.notice.success a {
  color: var(--color-success);
}
.notice.hidden {
  display: none;
}
/* Element-qualified so panel rules such as ".join p { margin: 0 }" cannot glue a notice to the buttons above. */
:is(p, div, section).notice {
  margin: var(--space-4) 0 0;
}

/* Checkbox with its sentence (element-qualified to outrank panel label rules). */
label.check {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: var(--space-3);
  align-items: start;
  margin: var(--space-4) 0 0;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
}
label.check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--color-accent);
  cursor: pointer;
}

/* File picker in the site style. */
input[type="file"] {
  max-width: 100%;
}
input[type="file"]::file-selector-button {
  margin-right: var(--space-3);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover {
  border-color: var(--color-violet);
  background: var(--color-surface-raised);
}

/* Empty list placeholder. */
.empty {
  margin: var(--space-2) 0 0;
  color: var(--color-text-subtle);
  font-size: var(--text-sm);
}

/* Moderator and status panels stacked above the page content keep the page rhythm. */
main > .panel:not(.hidden) {
  margin-bottom: var(--space-6);
}

.wallet-picker {
  background: #160828;
  color: #fff;
  border: 1px solid #963be5;
  border-radius: 20px;
  padding: 24px;
  max-width: 90vw;
  width: 420px;
}
.wallet-picker::backdrop {
  background: #000b;
}
.wallet-picker button {
  display: block;
  width: 100%;
  padding: 14px;
  margin: 12px 0;
  background: #321552;
  color: white;
  border: 1px solid #963be5;
  border-radius: 12px;
  cursor: pointer;
}
.mobile-wallet-link {
  display: block;
  text-align: center;
  padding: 14px;
  margin: 12px 0;
  color: white;
  background: #482178;
  border: 1px solid #9854e2;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 800;
}
.mobile-wallet-link:focus-visible {
  outline: 3px solid #ffbe00;
}
.confirm-dialog {
  box-sizing: border-box;
  background: #160828;
  color: #fff;
  border: 1px solid #963be5;
  border-radius: 20px;
  padding: 0;
  width: 460px;
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  box-shadow: 0 24px 80px #000c;
}
.confirm-dialog::backdrop {
  background: #000b;
  backdrop-filter: blur(3px);
}
.confirm-dialog > div {
  min-width: 0;
  padding: 28px;
}
.confirm-dialog h2 {
  margin: 0 0 12px;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.confirm-dialog p {
  margin: 0;
  color: #c9b8d3;
  font-size: 15px;
  line-height: 1.55;
}
.confirm-dialog dl {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  min-width: 0;
  margin: 18px 0 0;
  padding: 14px 16px;
  background: #0c0619;
  border: 1px solid #3c215a;
  border-radius: 12px;
  font-size: 14px;
}
.confirm-dialog dt {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #a996b8;
}
.confirm-dialog dd + dt {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid #3c215a;
}
.confirm-dialog dd {
  min-width: 0;
  margin: 0;
  text-align: left;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.confirm-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}
.confirm-actions button {
  box-sizing: border-box;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  text-align: center;
  width: 100%;
  min-height: 48px;
  margin: 0;
}
.confirm-actions.single-action {
  grid-template-columns: 1fr;
}
.confirm-actions .primary {
  background: var(--color-accent);
  border: 1px solid var(--color-accent);
  color: var(--color-on-accent, #13051f);
  box-shadow: 0 5px 0 var(--color-accent-shadow, #9c6000);
}
.confirm-actions .danger {
  background: #c0263f;
  border-color: #ff5c77;
  color: #fff;
}
