* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  min-height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  display: flex;
  justify-content: center;
  background: #f0f0f0;
}

.container {
  position: relative;
  width: 90%;
  max-width: 400px;
}

.background-img {
  width: 100%;
  height: auto;
  display: block;
}

.referral-section {
  position: absolute;
  top: 16.5%;
  left: 50%;
  transform: translateX(-50%);
  width: 88%;
}

.title {
  width: 38%;
  margin-bottom: 4px;
}

.title img {
  width: 100%;
  height: auto;
}

.referral-input-wrapper {
  display: flex;
  align-items: center;
  background: white;
  border: 2px solid #0AA566;
  border-radius: 25px;
  padding: 4px 4px 4px 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.referral-code {
  flex: 1;
  font-size: 24px;
  font-weight: bold;
  color: #24CF41;
  letter-spacing: 2px;
  min-width: 0;
}

.copy-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  height: 36px;
}

.copy-btn img {
  height: 100%;
  width: auto;
}

body.is-ar .title {
  margin-left: auto;
  margin-right: 0;
}

body.is-ar .referral-input-wrapper {
  flex-direction: row-reverse;
  padding: 4px 16px 4px 4px;
}

body.is-ar .referral-code {
  text-align: right;
}

.download-section {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 90%;
  max-width: 400px;
  margin: 0 auto;
  z-index: 100;
  line-height: 0;
  padding-bottom: env(safe-area-inset-bottom);
}

.download-btn {
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  margin: 0;
  line-height: 0;
}

.download-btn img {
  width: 80%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.75);
  color: white;
  padding: 32px 32px;
  border-radius: 8px;
  font-size: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 220px;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: 1000;
}

.toast.show {
  opacity: 1;
}

.toast img {
  width: 40px;
  height: auto;
  margin-bottom: 18px;
}

@media (max-width: 768px) {
  .container {
    width: 100%;
    max-width: 100vw;
  }

  .download-section {
    width: 100%;
    max-width: 100vw;
  }
}
