* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #f8f8f8;
  color: #1f2933;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  width: 100vw;
  overflow-x: hidden;
}

button {
  border: 0;
  font: inherit;
}

.screen {
  min-height: 100vh;
  padding: 24px 20px;
}

.welcome {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: transparent;
  min-height: 100vh;
  padding: 29px 42px 40px;
  text-align: center;
}

.welcome-header {
  display: grid;
  gap: 12px;
}

.brand-logo {
  display: block;
  width: 174px;
  height: auto;
  margin-right: auto;
  margin-left: auto;
  -webkit-touch-callout: none;
  user-select: none;
}

.welcome-brand {
  width: 139px;
  margin-bottom: 0;
}

.welcome-title {
  margin: 16px 0 0;
  color: #000;
  font-size: 45px;
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: 0;
}

.welcome-text {
  margin: 0;
  color: #858585;
  font-size: 16px;
  line-height: 1.4;
}

.welcome-hero {
  display: block;
  width: 100%;
  margin: 34px auto 26px;
}

.welcome-bottom {
  display: grid;
  gap: 21px;
}

.welcome-slogan {
  margin: 0;
  color: #000;
  font-size: 22px;
  font-weight: 300;
  line-height: 1.38;
}

.primary-btn {
  width: 100%;
  height: 68px;
  border: 1px solid #748d6b;
  border-radius: 0;
  background: transparent;
  color: #5f7858;
  font-size: 21px;
  font-weight: 400;
}

.phone-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(0, 0, 0, 0.42);
}

.phone-dialog {
  width: 100%;
  max-width: 360px;
  padding: 28px 24px 24px;
  background: #f8f8f8;
  border: 1px solid rgba(116, 141, 107, 0.45);
  text-align: center;
}

.phone-dialog h2 {
  margin: 0 0 22px;
  color: #000;
  font-size: 22px;
  font-weight: 400;
  line-height: 1.2;
}

.phone-input {
  width: 100%;
  height: 52px;
  padding: 0 14px;
  border: 1px solid #8c8c8c;
  border-radius: 0;
  background: transparent;
  color: #1f2933;
  font: inherit;
  font-size: 18px;
  text-align: center;
  outline: none;
}

.phone-input:focus {
  border-color: #748d6b;
}

.phone-error {
  min-height: 22px;
  margin: 8px 0 10px;
  color: #b42318;
  font-size: 13px;
  line-height: 1.5;
}

.phone-confirm {
  width: 100%;
  height: 52px;
  border: 1px solid #748d6b;
  background: #748d6b;
  color: #fff;
  font-size: 17px;
}

.plain-btn {
  width: 100%;
  height: 48px;
  border: 1px solid #c9bfae;
  border-radius: 8px;
  background: transparent;
  color: #1f2933;
  font-size: 14px;
}

.guard {
  display: grid;
  place-items: center;
  text-align: center;
  background: transparent;
}

.guard h1 {
  margin: 0 0 12px;
  font-size: 22px;
}

.guard p {
  margin: 0;
  color: #5b6570;
  line-height: 1.7;
}

.quiz {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 21px 26px 34px;
  background: transparent;
}

.quiz-header {
  margin-bottom: 34px;
}

.progress {
  margin-bottom: 32px;
  color: #000;
  font-size: 17px;
  font-weight: 400;
  text-align: center;
  letter-spacing: 0;
}

.progress span {
  display: inline-block;
  padding: 0 8px;
  font-size: 34px;
  line-height: 1;
}

.progress b {
  display: inline-block;
  padding: 0 22px;
  font-size: 32px;
  line-height: 1;
}

.question-title {
  margin: 0;
  color: #050505;
  font-size: 19px;
  font-weight: 400;
  line-height: 1.38;
  letter-spacing: 0;
}

.options {
  display: grid;
  gap: 20px;
}

.option {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 62px;
  padding: 12px 22px;
  border: 1px solid #898989;
  border-radius: 0;
  background: transparent;
  color: #3c3c3c;
  text-align: left;
}

.option.is-selected {
  border-color: #748d6b;
  background: #748d6b;
  color: #fff;
}

.option-text {
  font-size: 15px;
  font-weight: 400;
  line-height: 1.45;
}

.quiz-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 78px;
  margin-top: auto;
  padding-top: 52px;
}

.nav-btn {
  height: 62px;
  border: 1px solid #898989;
  border-radius: 0;
  background: transparent;
  color: #858585;
  font-size: 15px;
  font-weight: 400;
}

.nav-btn-primary {
  border-color: #748d6b;
  color: #5f7858;
}

.nav-btn:disabled {
  opacity: 0.45;
}

.result {
  background: transparent;
  min-height: 100vh;
  padding: 38px 38px 118px;
  color: #333;
  text-align: center;
}

.result-brand {
  display: block;
  width: 139px;
  margin-bottom: 31px;
}

.result-kicker {
  margin-bottom: 18px;
  color: #333;
  font-size: 18px;
  line-height: 1.2;
  -webkit-touch-callout: none;
  user-select: none;
}

.result-code {
  margin: 0;
  color: #617a5b;
  font-size: 38px;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: 0;
}

.result-name {
  margin-top: 12px;
  color: #617a5b;
  font-size: 19px;
  line-height: 1.2;
}

.result-person {
  display: block;
  width: 68%;
  max-width: 360px;
  margin: 42px auto 24px;
}

.result-title-image {
  display: block;
  width: 100%;
  max-width: 440px;
  margin: 0 auto 12px;
}

.result-subtitle {
  margin: 0 0 18px;
  color: #617a5b;
  font-size: 31px;
  font-weight: 400;
  line-height: 1.2;
}

.result-stars {
  margin-bottom: 5px;
  color: #333;
  font-size: 17px;
  line-height: 1.4;
}

.result-stars span {
  color: #617a5b;
  font-size: 25px;
  letter-spacing: 3px;
  vertical-align: -2px;
}

.result-tag {
  margin-bottom: 21px;
  color: #333;
  font-size: 15px;
  line-height: 1.45;
}

.result-description,
.result-guide {
  margin: 0;
  color: #858585;
  font-size: 18px;
  line-height: 1.75;
  text-align: left;
}

.result-guide-title {
  display: block;
  width: 62%;
  max-width: 280px;
  margin: 0 auto 22px;
}

.result-qr {
  display: block;
  width: 52%;
  max-width: 250px;
  margin: 36px auto 0;
}

.result-description {
  margin-bottom: 30px;
}

.result-image {
  display: block;
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(31, 41, 51, 0.14);
}

.save-tip {
  display: grid;
  width: 100%;
  height: 58px;
  margin: 0 0 52px;
  place-items: center;
  border: 1px solid #748d6b;
  color: #5f7858;
  font-size: 16px;
  text-align: center;
}

.result-bottom-bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 12;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 12px 38px calc(12px + env(safe-area-inset-bottom));
  background: rgba(248, 248, 248, 0.96);
  border-top: 1px solid rgba(116, 141, 107, 0.28);
}

.bar-btn {
  display: grid;
  height: 48px;
  place-items: center;
  border: 1px solid #748d6b;
  background: transparent;
  color: #5f7858;
  font-size: 15px;
  text-align: center;
}

.bar-btn-primary {
  background: #748d6b;
  color: #fff;
}

.poster-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.72);
}

.poster-panel {
  width: 100%;
  max-height: 92vh;
  text-align: center;
}

.poster-image {
  display: block;
  width: 100%;
  max-height: 74vh;
  object-fit: contain;
  background: #f8f8f8;
}

.poster-panel p {
  margin: 14px 0;
  color: #fff;
  font-size: 13px;
}

.poster-panel button {
  width: 100%;
  height: 44px;
  margin-top: 10px;
  border: 1px solid #fff;
  background: transparent;
  color: #fff;
  font-size: 14px;
}

.poster-download {
  border-color: #748d6b !important;
  background: #748d6b !important;
}

.generating-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(248, 248, 248, 0.86);
}

.generating-box {
  display: grid;
  justify-items: center;
  width: 100%;
  max-width: 280px;
  padding: 34px 24px;
  border: 1px solid #748d6b;
  background: #f8f8f8;
  text-align: center;
}

.generating-spinner {
  width: 38px;
  height: 38px;
  margin-bottom: 18px;
  border: 2px solid rgba(95, 120, 88, 0.22);
  border-top-color: #5f7858;
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

.generating-title {
  margin-bottom: 8px;
  color: #000;
  font-size: 18px;
}

.generating-text {
  color: #858585;
  font-size: 13px;
  line-height: 1.5;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 48px;
  z-index: 40;
  max-width: calc(100vw - 48px);
  padding: 12px 18px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  transform: translateX(-50%);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.stack {
  display: grid;
  gap: 12px;
}
