/* Common imports for all CSS modules */
/*
 * This source is generated by bin/gen/licon.py. Run licon.py after changing public/font/lichess.sfd
 *
 * Constant names and values are pulled from private use characters defined in the sfd file.
 *
 * Character names can be edited in fontforge's "glyph info" dialog, or by editing the StartChar: line that
 * begins each character chunk in lichess.sfd
 *
 * To make these characters visible in your editor, install the lichess.ttf font (which is also generated by
 * licon.py) and then add it to your editor's font list.
 */
/* Uniboard: keep the same page layout across pages */
/* text printed directly on the page background deserves special treatment (transp theme) */
:where(html.transp) dialog {
  backdrop-filter: blur(6px);
}
dialog {
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.15), 0 10px 10px rgba(0, 0, 0, 0.12);
}

.snab-modal-mask {
  position: fixed;
  inset: 0;
  background: var(--c-page-mask);
  z-index: 110;
}

.snab-modal-mask {
  /* extends %flex-center */
  display: flex;
  flex-flow: row wrap;
  align-items: center;
  justify-content: center;
}

dialog button.close-button {
  /* extends %flex-center */
  display: flex;
  flex-flow: row wrap;
  align-items: center;
  justify-content: space-around;
}

.dialog-content.alert, .dialog-content.debug {
  display: flex;
  flex-flow: column;
}

.dialog-content, dialog button.close-button, dialog {
  border-radius: var(---ui-roundness, 7px);
}

/* helps with clipping background into border-radius */
body:has(dialog.touch-scroll) {
  overflow: hidden !important;
}

html:not([dir=rtl]) dialog {
  left: 50%;
}
html[dir=rtl] dialog {
  right: 50%;
}
dialog {
  position: fixed;
  max-height: 100%;
  max-width: 100%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 0;
  border: none;
  outline: none;
  background: var(--c-bg-high);
  z-index: 111;
}
html[dir=rtl] dialog {
  transform: translate(50%, -50%);
}
dialog:has(.dialog-content.alert) {
  z-index: 200;
}
dialog::backdrop {
  background: var(--c-page-mask);
}
dialog > div.scrollable {
  max-height: calc(var(---viewport-height) - 16px);
  overflow-x: clip;
  overflow-y: auto;
}
dialog div.close-button-anchor {
  position: relative;
  width: 100%;
  height: 0;
}
html:not([dir=rtl]) dialog button.close-button {
  right: 4px;
}
html[dir=rtl] dialog button.close-button {
  left: 4px;
}
dialog button.close-button {
  position: absolute;
  top: 4px;
  width: 40px;
  height: 40px;
  z-index: 112;
  background: var(--c-bg-high);
  color: var(--c-font);
  border: 1px solid var(--c-border);
  font-size: 20px;
  text-align: center;
  cursor: pointer;
}
dialog button.close-button:not(:focus) {
  outline: none;
}
dialog:not(.touch-scroll) {
  margin-top: 16px;
  overflow: visible;
}
dialog:not(.touch-scroll) button.close-button {
  transform: translate(18px, -18px);
}
html[dir=rtl] dialog:not(.touch-scroll) button.close-button {
  transform: translate(-18px, -18px);
}
dialog:not(.touch-scroll) button.close-button {
  width: 32px;
  height: 32px;
  font-size: 16px;
  border-radius: 50%;
  border: none;
}
dialog:not(.touch-scroll) button.close-button:hover {
  box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.08), 0 3px 1px -2px rgba(0, 0, 0, 0.18), 0 1px 5px 0 rgba(0, 0, 0, 0.1);
  background: var(--c-bad);
  color: #fff;
}

.dialog-content {
  text-align: center;
  padding: 2em;
  color: var(--c-font);
}
.dialog-content.alert, .dialog-content.debug {
  gap: 2em;
  width: unset;
  height: unset;
  border: 3px solid var(--c-primary);
}
.dialog-content.alert {
  width: 480px;
  max-width: 100%;
  font-size: 16px;
}
.dialog-content.alert span {
  display: flex;
  gap: 2em;
  justify-content: end;
}
dialog.touch-scroll .dialog-content.alert span {
  justify-content: space-around;
}
.dialog-content.alert input {
  align-self: center;
  width: min(40ch, 90%);
}
.dialog-content.alert .invalid {
  background-color: color-mix(in oklab, var(--c-bad) 30%, var(--c-bg));
}
