@font-face {
  src: url('../fonts/manrope.woff2') format('woff2');
  font-family: 'Manrope';
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --background: #0E1013;
  --surface: #171A1F;
  color-scheme: dark;
  --border: #2A2F37;
  --hover: #1F2329;
  --muted: #8B919A;
  --green: #2BD47D;
  --panel: #15181D;
  --line: #23272E;
  --text: #F2F3F5;
  --soft: #C9CDD3;
  --tint: #13261C;
  --red: #FF5A5F;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  font-family: 'Manrope', system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
  font-variant-numeric: tabular-nums;
  -webkit-text-size-adjust: 100%;
  background: var(--background);
  flex-direction: column;
  color: var(--text);
  min-height: 100dvh;
  font-weight: 500;
  display: flex;
  margin: 0;
}

h1,
h2,
p {
  margin: 0;
}

button,
select,
input {
  color: inherit;
  font: inherit;
}

.top {
  padding: 22px 20px 0;
  max-width: 440px;
  margin: 0 auto;
  width: 100%;
}

.brand {
  letter-spacing: -0.3px;
  align-items: center;
  font-weight: 800;
  font-size: 18px;
  display: flex;
  gap: 10px;
}

.start {
  padding: 24px 20px 28px;
  flex-direction: column;
  max-width: 440px;
  display: flex;
  margin: auto;
  width: 100%;
  gap: 16px;
}

.setup {
  flex-direction: column;
  display: flex;
  gap: 16px;
}

.button {
  background: var(--green);
  color: var(--background);
  justify-content: center;
  border-radius: 16px;
  align-items: center;
  font-weight: 800;
  cursor: pointer;
  font-size: 17px;
  display: flex;
  height: 56px;
  width: 100%;
  border: 0;
}

.button:focus-visible,
.close:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.divider {
  color: var(--muted);
  align-items: center;
  font-weight: 700;
  font-size: 13px;
  margin: 16px 0;
  display: flex;
  gap: 12px;
}

.divider::before,
.divider::after {
  background: var(--line);
  content: '';
  height: 1px;
  flex: 1;
}

.group {
  min-width: 0;
  padding: 0;
  border: 0;
  margin: 0;
}

.group legend {
  margin-bottom: 8px;
  padding: 0;
}

.label {
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
}

.choices {
  grid-template-columns: 1fr 1fr;
  display: grid;
  gap: 8px;
}

.choice {
  position: relative;
  cursor: pointer;
}

.dropdown-option input,
.choice input {
  position: absolute;
  opacity: 0;
}

.choice span {
  border: 1px solid var(--border);
  background: var(--surface);
  justify-content: center;
  border-radius: 12px;
  align-items: center;
  color: var(--soft);
  font-weight: 600;
  font-size: 15px;
  display: flex;
  height: 44px;
}

.choice input:checked + span {
  border: 1.5px solid var(--green);
  background: var(--tint);
  color: var(--text);
  font-weight: 700;
}

.choice input:focus-visible + span {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.row {
  grid-template-columns: repeat(3, 1fr);
  display: grid;
  gap: 10px;
}

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

.field-head {
  justify-content: space-between;
  align-items: baseline;
  display: flex;
}

.input {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 12px;
  font-weight: 700;
  padding: 0 12px;
  font-size: 17px;
  outline: none;
  height: 48px;
  width: 100%;
}

.dropdown-choice:focus-visible,
.input:focus {
  box-shadow: 0 0 0 3px rgba(43, 212, 125, .2);
  border-color: var(--green);
  outline: none;
}

.input:-webkit-autofill {
  box-shadow: inset 0 0 0 40px var(--surface);
  -webkit-text-fill-color: var(--text);
}

.dropdown {
  position: relative;
}

.dropdown-choice {
  border: 1px solid var(--border);
  padding: 13px 44px 13px 14px;
  background: var(--surface);
  border-radius: 12px;
  position: relative;
  line-height: 1.35;
  text-align: left;
  font-weight: 700;
  min-height: 48px;
  cursor: pointer;
  font-size: 16px;
  width: 100%;
}

.dropdown-choice::after {
  transform: translateY(-75%) rotate(45deg);
  border: solid var(--muted);
  border-width: 0 2px 2px 0;
  position: absolute;
  content: '';
  height: 8px;
  right: 18px;
  width: 8px;
  top: 50%;
}

.dropdown-choice[aria-expanded="true"] {
  border-color: var(--green);
}

.dropdown-choice[aria-expanded="true"]::after {
  transform: translateY(-25%) rotate(225deg);
}

.dropdown-options {
  box-shadow: 0 12px 32px rgba(0, 0, 0, .5);
  border: 1px solid var(--border);
  background: var(--surface);
  top: calc(100% + 6px);
  border-radius: 12px;
  position: absolute;
  overflow: hidden;
  z-index: 10;
  right: 0;
  left: 0;
}

.dropdown-up {
  bottom: calc(100% + 6px);
  top: auto;
}

.dropdown-option {
  position: relative;
  cursor: pointer;
  display: block;
}

.dropdown-option + .dropdown-option {
  border-top: 1px solid var(--line);
}

.dropdown-option span {
  padding: 13px 14px;
  color: var(--soft);
  line-height: 1.35;
  font-weight: 600;
  font-size: 15px;
  display: block;
}

.dropdown-option input:checked + span {
  background: var(--tint);
  color: var(--text);
  font-weight: 700;
}

@media (hover: hover) {
  .dropdown-option:hover span {
    background: var(--hover);
  }
}

.value {
  font-weight: 800;
  font-size: 17px;
}

.slider {
  -webkit-appearance: none;
  background: transparent;
  appearance: none;
  cursor: pointer;
  --fill: 28.6%;
  height: 36px;
  width: 100%;
  margin: 0;
}

.slider::-webkit-slider-runnable-track {
  background: linear-gradient(to right, var(--green) var(--fill), var(--border) 0);
  border-radius: 3px;
  height: 6px;
}

.slider::-moz-range-track {
  background: linear-gradient(to right, var(--green) var(--fill), var(--border) 0);
  border-radius: 3px;
  height: 6px;
}

.slider::-webkit-slider-thumb {
  box-shadow: 0 2px 8px rgba(0, 0, 0, .45);
  -webkit-appearance: none;
  background: var(--text);
  border-radius: 50%;
  margin-top: -10px;
  height: 26px;
  width: 26px;
  border: 0;
}

.slider::-moz-range-thumb {
  box-shadow: 0 2px 8px rgba(0, 0, 0, .45);
  background: var(--text);
  border-radius: 50%;
  height: 26px;
  width: 26px;
  border: 0;
}

.slider:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 4px;
  border-radius: 8px;
}

.modal {
  width: calc(100% - 40px);
  background: var(--hover);
  border-radius: 22px;
  color: var(--text);
  max-height: 90dvh;
  max-width: 400px;
  margin: auto;
  padding: 0;
  border: 0;
}

.modal[open] {
  animation: rise .2s ease-out;
}

.modal::backdrop {
  background: rgba(0, 0, 0, .85);
}

.modal-body {
  flex-direction: column;
  padding: 20px;
  display: flex;
  gap: 16px;
}

.modal-head {
  justify-content: space-between;
  align-items: center;
  display: flex;
}

.modal-head h2 {
  font-weight: 800;
  font-size: 20px;
}

.modal-text {
  color: var(--muted);
  line-height: 1.45;
  margin-top: -8px;
  font-size: 14px;
}

.close {
  justify-content: center;
  background: transparent;
  color: var(--muted);
  margin-right: -10px;
  border-radius: 12px;
  align-items: center;
  cursor: pointer;
  display: flex;
  height: 44px;
  width: 44px;
  border: 0;
}

body:has(:modal) {
  overflow: hidden;
}

@keyframes rise {
  from {
    transform: translateY(12px);
    opacity: 0;
  }
}
