.byroco-cz {
  --custom-font: 'Anybody', sans-serif;
}

.byroco-cz__overlay {
  --custom-font: 'Anybody', sans-serif;
  position: fixed; inset: 0; z-index: 100000000;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(78, 59, 49, .55);
}
.byroco-cz__overlay[hidden] { display: none; }

.byroco-cz__modal {
  box-sizing: border-box;
  width: 100%; max-height: 92vh; overflow-y: auto;
  background: #fff; border-radius: 4px 4px 0 0;
  padding: 20px 18px 24px;
}
@media (min-width: 768px) {
  .byroco-cz__overlay { align-items: center; }
  .byroco-cz__modal { width: 480px; border-radius: 4px; padding: 28px; }
}

.byroco-cz__preview {
  position: relative; width: 100%; aspect-ratio: 4/5; overflow: hidden; border-radius: 0;
  container-type: inline-size;
}
.byroco-cz__layers img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .18s ease;
}
.byroco-cz__layers img.is-active { opacity: 1; }

.byroco-cz__text-layer {
  position: absolute; transform: translate(-50%, -50%);
  font-family: var(--custom-font, serif);
  font-weight: 900;
  white-space: pre;
  pointer-events: none;
}

.byroco-cz__text-layer > span { display: inline-block; }

.byroco-cz__variants {
  display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0;
}
.byroco-cz__variant-btn {
  padding: 6px 12px; border: 1px solid #DDDDDD; border-radius: 0; background: #F8F8F8;
  color: #4E3B31; font-family: font, Arial, sans-serif; cursor: pointer;
}
.byroco-cz__variant-btn.is-active {
  border-color: #4E3B31; background: #4E3B31; color: #fff;
}

.byroco-cz__colors {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 14px 0;
}
.byroco-cz__color-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 35px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: font, Arial, sans-serif;
  font-size: 0;
  color: #4E3B31;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  appearance: none;
}
.byroco-cz__color-btn::before {
  content: "";
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(78, 59, 49, .25);
  background-image: none;
  box-shadow: none;
}
.byroco-cz__color-btn[data-color="gold"]::before   { background: #CFBA29; }
.byroco-cz__color-btn[data-color="silver"]::before { background: #D7D6D2; }
.byroco-cz__color-btn[data-color="blind"]::before  { background: #372D2B; }
.byroco-cz__color-btn.is-active::before {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #4E3B31;
}

.byroco-cz__counter {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 14px 24px 0 0;
  font-family: font, Arial, sans-serif;
  font-size: 16px;
  color: #4E3B31;
  vertical-align: middle;
}
.byroco-cz__backspace {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 14px 24px 0 0;
  padding: 6px 14px;
  border: 1px solid #DDDDDD;
  border-radius: 5px;
  background: #F8F8F8;
  color: #4E3B31;
  font-family: font, Arial, sans-serif;
  font-size: 13px;
  cursor: pointer;
  vertical-align: middle;
}

.byroco-cz__hint {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 14px 0 0;
  font-family: font, Arial, sans-serif;
  font-size: 13px;
  font-style: italic;
  color: rgba(78, 59, 49, .55);
  vertical-align: middle;
  pointer-events: none;
}
.byroco-cz__hint[hidden] { display: none; }

.byroco-cz__keys {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 14px;
}
.byroco-cz__keys button {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #DDDDDD;
  border-radius: 5px;
  background: #F8F8F8;
  color: #4E3B31;
  font-family: font, Arial, sans-serif;
  font-size: 14px;
  cursor: pointer;
}
.byroco-cz__keys button:disabled {
  color: #BDBDBD;
  border-color: #C4C4C4;
  background: #F8F8F8;
  cursor: not-allowed;
}

.byroco-cz__keys button.byroco-cz__key_space {
  width: auto;
  min-width: 104px;
  padding: 0 14px;
}

.byroco-cz__error {
  margin: 14px 0 0;
  font-family: font, Arial, sans-serif;
  font-size: 13px;
  line-height: 1.4;
  color: #B03A2E;
}
.byroco-cz__error[hidden] { display: none; }

.byroco-cz__submit {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  height: 45px;
  padding: 7.4px 15px;
  margin: 24px 0 0;
  border: 1px solid #4E3B31;
  border-radius: 0;
  background: transparent;
  color: #4E3B31;
  font-family: font, Arial, sans-serif;
  font-size: 13px;
  font-weight: 300;
  line-height: 18.2px;
  cursor: pointer;
}
.byroco-cz__submit:disabled {
  color: #BDBDBD;
  border-color: #C4C4C4;
  cursor: not-allowed;
}

.byroco-cz__overlay,
.byroco-cz__modal,
.byroco-cz__keys button,
.byroco-cz__backspace,
.byroco-cz__variant-btn,
.byroco-cz__color-btn,
.byroco-cz__submit {
  touch-action: manipulation;
}

.byroco-cz__keys button,
.byroco-cz__backspace,
.byroco-cz__variant-btn,
.byroco-cz__submit {
  -webkit-tap-highlight-color: transparent;
}