/* Only the mode chooser and free-contest form. Paid raffle steps retain their
 * existing styles, and the parent sheet remains responsible for scrolling. */
/* A recent success toast may overlap the sheet handle. Plain notifications
 * must not prevent closing the form while the next request is being checked. */
body.create-raffle-open #notification-container .toast-notification:not(:has(button, a, input, select, textarea)) {
  pointer-events: none;
}

#crStepMode,
#crStepContest {
  min-width: 0;
  color: #fff;
  font-family: inherit;
  font-weight: 450;
  line-height: 1.45;
}

:is(#crStepMode, #crStepContest) * {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:is(#crStepMode, #crStepContest) :is(button, input, select, textarea) {
  font-family: inherit;
}

:is(#crStepMode, #crStepContest) button {
  touch-action: manipulation;
  -webkit-appearance: none;
  appearance: none;
}

:is(#crStepMode, #crStepContest) button:focus-visible {
  outline: 2px solid #00e676;
  outline-offset: 3px;
}

:is(#crStepMode, #crStepContest) :is(input, select, textarea):focus-visible {
  outline: 2px solid #89939f;
  outline-offset: 2px;
}

#crStepMode .create-raffle-subtitle {
  margin: 0 0 12px;
  color: #9ca1b0;
  font-size: 14px;
  font-weight: 450;
  line-height: 20px;
}

#crStepMode .create-raffle-mode-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

#crStepMode .create-raffle-mode-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
  min-height: 80px;
  margin: 0;
  padding: 14px;
  border: 1px solid #292c33;
  border-radius: 14px;
  background: #181a1f;
  box-shadow: none;
  color: #fff;
  text-align: left;
  cursor: pointer;
  transition: transform 200ms cubic-bezier(.22, 1, .36, 1), border-color 150ms ease;
}

#crStepMode .create-raffle-mode-btn > img,
#crStepMode .create-raffle-mode-icon {
  display: block;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  object-fit: contain;
}

#crStepMode .create-raffle-mode-text {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

#crStepMode .create-raffle-mode-name {
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  line-height: 20px;
  overflow-wrap: anywhere;
}

#crStepMode .create-raffle-mode-desc {
  color: #9ca1b0;
  font-size: 12px;
  font-weight: 450;
  line-height: 17px;
  overflow-wrap: anywhere;
}

#crStepContest [hidden] { display: none !important; }

#crStepContest .create-raffle-subtitle {
  margin: 0 0 16px;
  color: #9ca1b0;
  font-size: 14px;
  font-weight: 450;
  line-height: 20px;
  overflow-wrap: anywhere;
}

#crStepContest .create-raffle-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  margin: 0 0 16px;
}

#crStepContest .create-raffle-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

#crStepContest .create-raffle-label {
  color: #c1c5d0;
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
}

#crStepContest :is(.create-raffle-input, .create-raffle-select) {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  margin: 0;
  padding: 12px;
  border: 1px solid #292c33;
  border-radius: 12px;
  background: #181a1f;
  box-shadow: none;
  color: #fff;
  color-scheme: dark;
  font-size: 16px;
  font-weight: 450;
  line-height: 22px;
  transition: border-color 150ms ease;
}

#crStepContest .create-raffle-input::placeholder { color: #777d8b; opacity: 1; }
#crStepContest :is(.create-raffle-input, .create-raffle-select):focus { border-color: #89939f; }
#crStepContest :is(.create-raffle-input, .create-raffle-select):disabled { opacity: .45; cursor: not-allowed; }
#crStepContest textarea.create-raffle-input { min-height: 106px; max-height: 240px; resize: vertical; }

#crStepContest .ct-gift-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

#crStepContest .ct-gift-list:empty { display: none; }

#crStepContest .ct-gift-item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  grid-template-areas: "image rank remove" "image name remove";
  align-items: center;
  column-gap: 10px;
  row-gap: 2px;
  min-width: 0;
  min-height: 66px;
  padding: 10px;
  border: 1px solid #292c33;
  border-radius: 12px;
  background: #181a1f;
}

#crStepContest .ct-gift-rank {
  grid-area: rank;
  align-self: end;
  min-width: 0;
  color: #9ca1b0;
  font-size: 11px;
  font-weight: 450;
  line-height: 16px;
  overflow-wrap: anywhere;
}

#crStepContest .ct-gift-image {
  display: block;
  grid-area: image;
  width: 40px;
  height: 40px;
  object-fit: contain;
}

#crStepContest .ct-gift-name {
  grid-area: name;
  align-self: start;
  min-width: 0;
  overflow: hidden;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#crStepContest .ct-gift-del {
  display: flex;
  grid-area: remove;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 10px 6px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  color: #9ca1b0;
  font-size: 12px;
  font-weight: 500;
  line-height: 20px;
  cursor: pointer;
  transition: transform 200ms cubic-bezier(.22, 1, .36, 1), color 150ms ease;
}

#crStepContest #ctAddGift {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 11px 16px;
  border: 1px solid #292c33;
  border-radius: 999px;
  background: #181a1f;
  box-shadow: none;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  cursor: pointer;
  transition: transform 200ms cubic-bezier(.22, 1, .36, 1), border-color 150ms ease;
}

#crStepContest .create-raffle-toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 48px;
  margin: 0;
  padding: 12px;
  border: 1px solid #292c33;
  border-radius: 12px;
  background: #181a1f;
  color: #fff;
  cursor: pointer;
  touch-action: manipulation;
}

/* The native input remains visible and focusable; its entire label is a hit
 * target. Only the paid form keeps the legacy decorative switch. */
#crStepContest .create-raffle-toggle-label input[type="checkbox"],
#crStepContest .create-raffle-check-ask input[type="radio"] {
  display: block;
  position: static;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  min-width: 20px;
  margin: 0;
  padding: 0;
  opacity: 1;
  -webkit-appearance: auto;
  appearance: auto;
  accent-color: #00e676;
  color-scheme: dark;
  cursor: pointer;
}

#crStepContest .create-raffle-toggle-check { display: none; }

#crStepContest .create-raffle-toggle-name {
  min-width: 0;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  overflow-wrap: anywhere;
}

#crStepContest .ct-gate-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  margin: 2px 0 0;
  padding: 4px 0 4px 12px;
  border-left: 2px solid #292c33;
}

#crStepContest .create-raffle-check-ask {
  min-width: 0;
  width: 100%;
  margin: 6px 0 0;
  padding: 8px 12px;
  border: 1px solid #292c33;
  border-radius: 12px;
  background: #181a1f;
}

#crStepContest .create-raffle-check-ask legend {
  max-width: 100%;
  padding: 0 4px;
  color: #c1c5d0;
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
  overflow-wrap: anywhere;
}

#crStepContest .create-raffle-check-ask label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 8px 0;
  color: #c1c5d0;
  font-size: 13px;
  font-weight: 450;
  line-height: 18px;
  overflow-wrap: anywhere;
  cursor: pointer;
  touch-action: manipulation;
}

#crStepContest :is(.create-raffle-toggle-label, .create-raffle-check-ask label):has(input:disabled) {
  opacity: .45;
  cursor: not-allowed;
}

#crStepContest :is(.create-raffle-toggle-label, .create-raffle-check-ask) input:disabled { cursor: not-allowed; }

#crStepContest .create-raffle-duration {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 8px;
  min-width: 0;
}

#crStepContest .create-raffle-hint {
  margin: 0;
  color: #9ca1b0;
  font-size: 12px;
  font-weight: 450;
  line-height: 18px;
  overflow-wrap: anywhere;
}

#crStepContest .create-raffle-hint b,
#crStepContest .create-raffle-hint strong { color: #c1c5d0; font-weight: 500; }

#crStepContest .create-raffle-check-result {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  margin: 2px 0 0;
}

#crStepContest .create-raffle-check-result:empty,
#crStepContest .create-raffle-hint:empty { display: none; }

#crStepContest :is(.create-raffle-check-ok, .create-raffle-check-bad) {
  min-width: 0;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 450;
  line-height: 18px;
  overflow-wrap: anywhere;
}

#crStepContest .create-raffle-check-ok { border-color: #00e67626; background: #00e6760d; color: #00e676; }
#crStepContest .create-raffle-check-bad { border-color: #ff776b26; background: #ff776b0d; color: #ff9b91; }

#crStepContest :is(.create-raffle-check-btn, #ctSubmit) {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  box-shadow: none;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  text-align: center;
  cursor: pointer;
  transition: transform 200ms cubic-bezier(.22, 1, .36, 1), border-color 150ms ease;
}

#crStepContest .create-raffle-check-btn {
  margin: 4px 0 0;
  border-color: #292c33;
  background: #181a1f;
  color: #fff;
}

#crStepContest #ctDebitNote { margin-top: 12px; }
#crStepContest #ctCreateError:not(:empty) { margin: 12px 0; }
#crStepContest #ctSubmit { margin: 12px 0 0; background: linear-gradient(90deg, #00e676, #00fce0); color: #0a0b0e; }

#crStepMode .create-raffle-mode-btn:disabled,
#crStepContest :is(.create-raffle-check-btn, #ctSubmit, #ctAddGift, .ct-gift-del):disabled { opacity: .4; cursor: not-allowed; transform: none; }

#crStepMode .create-raffle-mode-btn:not(:disabled):active,
#crStepContest :is(.create-raffle-check-btn, #ctSubmit, #ctAddGift, .ct-gift-del):not(:disabled):active {
  transform: scale(.98);
  transition-duration: 100ms;
}

@media (hover: hover) and (pointer: fine) {
  #crStepMode .create-raffle-mode-btn:not(:disabled):hover,
  #crStepContest :is(.create-raffle-check-btn, #ctAddGift):not(:disabled):hover { border-color: #484d59; }
  #crStepContest .ct-gift-del:not(:disabled):hover { color: #c1c5d0; }
}

@media (max-width: 359px) {
  #crStepMode .create-raffle-mode-btn { gap: 10px; padding: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  #crStepMode .create-raffle-mode-btn,
  #crStepMode .create-raffle-mode-btn:not(:disabled):active,
  #crStepContest :is(.create-raffle-input, .create-raffle-select, .create-raffle-check-btn, #ctSubmit, #ctAddGift, .ct-gift-del),
  #crStepContest :is(.create-raffle-check-btn, #ctSubmit, #ctAddGift, .ct-gift-del):not(:disabled):active { transition: none; transform: none; }
}

html[data-reduce-effects="true"] #crStepMode .create-raffle-mode-btn,
html[data-reduce-effects="true"] #crStepMode .create-raffle-mode-btn:not(:disabled):active,
html[data-reduce-effects="true"] #crStepContest :is(.create-raffle-input, .create-raffle-select, .create-raffle-check-btn, #ctSubmit, #ctAddGift, .ct-gift-del),
html[data-reduce-effects="true"] #crStepContest :is(.create-raffle-check-btn, #ctSubmit, #ctAddGift, .ct-gift-del):not(:disabled):active { transition: none; transform: none; }
