/* Park to Win — single-post gamification popup */
.ptw {
  --ptw-green: #079271;
  --ptw-navy: #15172e;
  --ptw-muted: #555963;
  --ptw-subtle: #a7abb3;
  --ptw-dark: #1c1e21;
  --ptw-mint: #0cf0bb;
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.ptw.is-open {
  display: flex;
}

.ptw__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 18, 35, 0.5);
  cursor: default;
}

.ptw__dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 576px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  font-family: "Inter", sans-serif;
}

.ptw__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 28px;
  height: 28px;
  padding: 4px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #555;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ptw__close:hover,
.ptw__close:focus {
  background: #f0f0f0;
  outline: none;
}

.ptw__screen {
  display: none;
}

.ptw__screen.is-active {
  display: block;
  padding: 3px;
  box-sizing: border-box;
}

.ptw__header {
  padding: 40px 24px 0;
  text-align: center;
}

.ptw__title {
  margin: 0 0 12px;
  font-family: "Plus Jakarta Sans", "Inter", sans-serif;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ptw-navy);
}

.ptw__title-accent {
  display: block;
  color: var(--ptw-green);
}

.ptw__title-main {
  display: block;
  color: var(--ptw-navy);
}

.ptw__subtitle {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--ptw-muted);
}

.ptw__parking {
  position: relative;
  width: 100%;
  margin-top: 24px;
  overflow: hidden;
  border-radius: 0 0 8px 8px;
}

.ptw__game-section {
  background: var(--ptw-dark);
}

.ptw__slots {
  display: flex;
  justify-content: center;
  width: 100%;
  border-top: 2px solid #d3d5d9;
}

.ptw__slot {
  flex: 0 0 92px;
  width: 92px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 2px solid #d3d5d9;
  cursor: pointer;
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  transition: background 0.2s ease;
  box-sizing: border-box;
}

.ptw__slot:first-child {
  border-left: 2px solid #d3d5d9;
}

.ptw__slot:hover {
  background: rgba(255, 255, 255, 0.08);
}

.ptw__slot.is-chosen {
  background: rgba(12, 240, 187, 0.05);
}

.ptw__slot-num {
  color: var(--ptw-subtle);
  font-size: 16px;
  font-weight: 500;
  transition: opacity 0.2s ease;
}

.ptw__slot.is-chosen .ptw__slot-num {
  color: var(--ptw-mint);
  font-size: 20px;
}

.ptw__slot-reward {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  font-size: 13px;
  font-weight: 500;
  color: #717683;
  text-align: center;
  line-height: 1.5;
  padding: 0 4px;
  transition: opacity 0.3s ease 0.15s;
}

.ptw__parking.is-rewarded .ptw__slot-num {
  opacity: 0;
}

.ptw__parking.is-rewarded .ptw__slot-reward {
  opacity: 1;
}

.ptw__slot.is-chosen .ptw__slot-reward {
  color: var(--ptw-mint);
}

.ptw__winner {
  position: absolute;
  inset: 0;
  z-index: 6;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  transition: opacity 0.3s ease 0.25s;
}

.ptw__parking.is-rewarded .ptw__slot.is-chosen .ptw__winner {
  opacity: 1;
}

/* Car stays in the winning spot, then soft dark blur sits over it (Figma). */
.ptw__winner-car {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 64px;
  height: 86px;
  max-width: none;
  transform: translate(-50%, -50%);
  object-fit: contain;
  pointer-events: none;
  z-index: 0;
}

.ptw__winner-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2.5px);
  -webkit-backdrop-filter: blur(2.5px);
}

.ptw__winner-content {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 4px;
  box-sizing: border-box;
}

.ptw__winner-check {
  width: 20px;
  height: 20px;
  display: block;
}

.ptw__winner-text {
  font-size: 16px;
  font-weight: 500;
  color: var(--ptw-mint);
  text-align: center;
  line-height: 1.5;
}

.ptw__winner-sub {
  font-size: 11px;
  font-weight: 400;
  color: #fff;
  text-align: center;
  line-height: 1.5;
}

.ptw__car-area {
  /* 32px gap (Figma) + car (~90px) + 8px bottom offset used by layoutCar */
  height: 130px;
  overflow: hidden;
  transition: height 0.4s ease;
}

.ptw__parking.is-rewarded .ptw__car-area {
  height: 0;
}

.ptw__car {
  position: absolute;
  width: 56px;
  height: 90px;
  z-index: 5;
  cursor: grab;
  transform: translate3d(0, 0, 0);
  transition: transform 0.6s cubic-bezier(0.45, 0, 0.2, 1), opacity 0.25s ease;
  will-change: transform;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.ptw__car.is-dragging {
  cursor: grabbing;
}

.ptw__parking.is-rewarded .ptw__car {
  pointer-events: none;
  opacity: 0;
}

.ptw__car-arrow {
  width: 56px;
  height: 12px;
  display: block;
  flex-shrink: 0;
  pointer-events: none;
}

.ptw__car-img {
  width: 56px;
  height: 76px;
  display: block;
  object-fit: contain;
  pointer-events: none;
}

.ptw__game-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 4px 16px 20px;
  overflow: hidden;
  max-height: 120px;
  opacity: 1;
  transition: max-height 0.3s ease, opacity 0.2s ease, padding 0.3s ease;
}

.ptw__parking.is-rewarded .ptw__game-controls {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  pointer-events: none;
}

.ptw__instruction {
  margin: 0;
  color: var(--ptw-subtle);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3px;
  text-align: center;
  text-transform: uppercase;
}

.ptw__pick-btn {
  background: #ffffff;
  border: 1px solid #e9eaec;
  border-radius: 20px;
  padding: 5px 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: #717683;
  cursor: pointer;
  line-height: 1.5;
}

.ptw__pick-btn:hover,
.ptw__pick-btn:focus {
  background: #f5f5f5;
  outline: none;
}

.ptw__form-area {
  position: relative;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.4s ease 0.1s, opacity 0.3s ease 0.15s;
}

.ptw__parking.is-rewarded .ptw__form-area {
  max-height: 260px;
  opacity: 1;
}

.ptw__parking.is-rewarded.is-email-sent .ptw__form-area {
  max-height: 360px;
}

.ptw__reward-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 303px;
  margin: 0 auto;
  padding: 24px 24px 24px;
  box-sizing: border-box;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.ptw__parking.is-rewarded.is-email-sent .ptw__reward-form {
  opacity: 0;
  pointer-events: none;
  position: absolute;
  inset: 0;
}

.ptw__reward-label {
  display: block;
  margin: 0;
  color: #ffffff;
  font-family: "Plus Jakarta Sans", "Inter", sans-serif;
  font-size: 12px;
  font-weight: 500;
  line-height: normal;
}

.ptw__reward-email {
  width: 100%;
  box-sizing: border-box;
  padding: 16px 14px;
  background: transparent;
  border: 1px solid #393b42;
  border-radius: 8px;
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  outline: none;
  transition: border-color 0.2s ease;
}

.ptw__reward-email::placeholder {
  color: #717683;
}

.ptw__reward-email:focus {
  border-color: var(--ptw-mint);
}

.ptw__reward-email.is-error {
  border-color: #e03e3e;
}

.ptw__reward-error {
  margin: -8px 0 0;
  color: #e03e3e;
  font-size: 12px;
  line-height: 1.4;
  text-align: right;
}

.ptw__send-btn {
  width: 100%;
  min-height: 44px;
  max-height: 44px;
  padding: 12px 20px;
  border: 0;
  border-radius: 6px;
  background: #f1f2f9;
  color: var(--ptw-navy);
  font-family: "Plus Jakarta Sans", "Inter", sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease;
}

.ptw__send-btn:hover,
.ptw__send-btn:focus {
  background: #e4e5f0;
  outline: none;
}

.ptw__send-btn:disabled {
  opacity: 0.65;
  cursor: default;
}

.ptw__success {
  display: none;
  flex-direction: column;
  gap: 16px;
  padding: 20px 24px 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.ptw__parking.is-rewarded.is-email-sent .ptw__success {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.ptw__email-sent {
  margin: 0;
  font-size: 13px;
  color: var(--ptw-subtle);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ptw__email-sent-address {
  color: var(--ptw-mint);
  font-weight: 500;
  word-break: break-all;
}

.ptw__email-edit {
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  color: var(--ptw-mint);
  opacity: 0.9;
  flex-shrink: 0;
}

.ptw__email-edit:hover,
.ptw__email-edit:focus {
  opacity: 1;
  outline: none;
}

.ptw__success-desktop {
  display: block;
}

.ptw__success-mobile {
  display: none;
}

.ptw__qr-steps {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: center;
}

.ptw__qr-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.ptw__qr-image {
  width: 90px;
  height: 90px;
  display: block;
  border-radius: 6px;
  background: #fff;
  object-fit: cover;
}

.ptw__qr-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.8px;
  color: var(--ptw-subtle);
  text-align: center;
}

.ptw__steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  counter-reset: ptw-steps;
}

.ptw__steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #ffffff;
  line-height: 1.4;
  counter-increment: ptw-steps;
}

.ptw__steps li::before {
  content: counter(ptw-steps);
  min-width: 22px;
  height: 22px;
  background: var(--ptw-mint);
  color: #0d0d0d;
  font-size: 11px;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ptw__app-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  margin-top: 4px;
  padding: 12px 20px;
  border-radius: 6px;
  background: var(--ptw-mint);
  color: #023126;
  font-family: "Plus Jakarta Sans", "Inter", sans-serif;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  box-sizing: border-box;
}

.ptw__app-cta:hover,
.ptw__app-cta:focus {
  opacity: 0.92;
  color: #023126;
  text-decoration: none;
  outline: none;
}

body.ptw-open {
  overflow: hidden;
}

@media (max-width: 767.98px) {
  .ptw__dialog {
    max-width: 335px;
  }

  .ptw__header {
    padding: 40px 16px 0;
  }

  .ptw__slots {
    justify-content: stretch;
  }

  .ptw__slot {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    height: 104px;
  }

  .ptw__winner-car {
    width: 56px;
    height: 76px;
  }

  .ptw__winner-text {
    font-size: 14px;
  }

  .ptw__slot-reward {
    font-size: 11px;
  }

  .ptw__car-area {
    /* 32px gap + car (~82px) + 8px bottom offset */
    height: 122px;
  }

  .ptw__car {
    width: 48px;
    height: 82px;
  }

  .ptw__car-arrow {
    width: 48px;
    height: 11px;
  }

  .ptw__car-img {
    width: 48px;
    height: 69px;
  }

  .ptw__reward-form {
    max-width: none;
    padding: 20px 16px 20px;
  }

  .ptw__parking.is-rewarded .ptw__form-area {
    max-height: 250px;
  }

  .ptw__parking.is-rewarded.is-email-sent .ptw__form-area {
    max-height: 400px;
  }

  .ptw__success {
    padding: 20px 16px 20px;
  }

  .ptw__success-desktop {
    display: none;
  }

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

@media (max-width: 374px) {
  .ptw__dialog {
    max-width: 100%;
  }

  .ptw__title {
    font-size: 18px;
  }
}
