.auth-page {
  min-height: 100vh;
  padding: calc(var(--nav-h) + 42px) 18px 72px;
  background:
    radial-gradient(circle at 8% 14%, rgba(99, 184, 47, .15), transparent 28rem),
    radial-gradient(circle at 92% 20%, rgba(249, 115, 22, .12), transparent 25rem),
    var(--bg);
}

.auth-container {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.login-card {
  width: min(520px, 100%);
  margin: 0 auto;
  padding: 36px 40px 40px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 18px 55px rgba(47, 92, 25, .13);
}

.game-end-auth-page {
  background:
    radial-gradient(circle at 12% 18%, rgba(99, 184, 47, .24), transparent 30rem),
    radial-gradient(circle at 88% 16%, rgba(249, 115, 22, .2), transparent 28rem),
    linear-gradient(145deg, #f1ffe9, #fff9e9 62%, #f5fff0);
}

.game-end-login-layout {
  width: min(1040px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr);
  gap: 25px;
  align-items: stretch;
}

.game-end-signup-layout {
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, .92fr);
  align-items: stretch;
}

.game-end-login-card {
  width: auto;
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.game-result-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: clamp(28px, 4vw, 46px);
  border: 2px solid rgba(255,255,255,.58);
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 18%, rgba(255,255,255,.18), transparent 35%),
    linear-gradient(145deg, #3e941e, #63b82f 58%, #8bd653);
  box-shadow: 0 22px 58px rgba(48, 115, 20, .24);
  color: #fff;
  text-align: center;
}

.game-result-card::after {
  position: absolute;
  right: -85px;
  bottom: -95px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  content: '';
}

.game-result-kicker {
  position: relative;
  z-index: 2;
  display: inline-flex;
  margin: 0 0 13px;
  padding: 7px 14px;
  border: 1.5px solid rgba(255,255,255,.45);
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  font-size: .77rem;
  font-weight: 1000;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.game-result-logo {
  position: relative;
  z-index: 2;
  width: min(310px, 82%);
  margin: 0 auto -2px;
  display: block;
  transform: rotate(-3deg);
  transition: transform .24s cubic-bezier(.2,.85,.25,1.2);
}

.game-result-logo:hover,
.game-result-logo:focus-visible {
  transform: rotate(2deg) scale(1.07);
}

.game-result-logo:focus-visible {
  outline: 3px solid #fff0a7;
  outline-offset: 5px;
  border-radius: 18px;
}

.game-result-logo img {
  display: block;
  width: 100%;
  height: 155px;
  object-fit: contain;
  filter: drop-shadow(0 14px 18px rgba(27,80,8,.3));
  animation: game-result-logo-float 3s ease-in-out infinite;
}

.game-result-card :is(h1, h2) {
  position: relative;
  z-index: 2;
  margin: 4px 0 15px;
  color: #fff;
  font: 400 clamp(1.8rem, 4vw, 2.55rem)/1 'Paytone One', system-ui;
  text-shadow: 0 3px 12px rgba(30,89,10,.22);
}

.game-result-score {
  position: relative;
  z-index: 2;
  width: min(330px, 100%);
  margin: 0 auto;
  padding: 14px 18px 16px;
  border: 1.5px solid rgba(255,255,255,.75);
  border-radius: 20px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 13px 28px rgba(29,87,10,.2);
}

.game-result-score span,
.game-result-score small {
  display: block;
  color: var(--muted);
  font-size: .73rem;
  font-weight: 1000;
  letter-spacing: .08em;
  line-height: 1;
  text-transform: uppercase;
}

.game-result-score strong {
  display: block;
  margin: 5px 0;
  color: var(--orange);
  font: 400 clamp(2.15rem, 6vw, 3.25rem)/1 'Paytone One', system-ui;
  overflow-wrap: anywhere;
}

.game-result-stars {
  position: relative;
  z-index: 2;
  min-height: 52px;
  margin: 18px auto 3px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.game-result-stars span {
  display: inline-block;
  color: #ffe45c;
  font-size: clamp(1.65rem, 4vw, 2.35rem);
  line-height: 1;
  opacity: 0;
  transform: translateY(-18px) rotate(-25deg) scale(.15);
  filter: drop-shadow(0 4px 4px rgba(82,60,0,.25));
  animation: game-result-star-pop .48s cubic-bezier(.2,.9,.25,1.45) forwards;
  animation-delay: var(--star-delay);
}

.game-result-stars b {
  margin-left: 5px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.2);
  font-family: 'Paytone One', system-ui;
}

.game-result-stars em {
  color: rgba(255,255,255,.88);
  font-size: .86rem;
  font-style: normal;
  font-weight: 800;
}

.game-result-stars-label {
  position: relative;
  z-index: 2;
  margin: 0 0 18px;
  color: rgba(255,255,255,.9);
  font-size: .88rem;
  font-weight: 800;
}

.game-result-stars-label strong {
  color: #fff0a7;
  font: 400 1.15rem 'Paytone One', system-ui;
}

.game-result-save-warning {
  position: relative;
  z-index: 2;
  width: min(390px, 100%);
  margin: 0 auto 15px;
  padding: 12px 14px;
  border: 2px solid #ffe071;
  border-radius: 15px;
  background: #fff7cf;
  color: #6f4a00;
  box-shadow: 0 9px 22px rgba(77,55,0,.15);
  text-align: left;
}

.game-result-save-warning strong {
  display: block;
  margin-bottom: 3px;
  color: #b45309;
  font: 400 .94rem 'Paytone One', system-ui;
}

.game-result-save-warning span {
  display: block;
  font-size: .8rem;
  font-weight: 800;
  line-height: 1.4;
}

.game-result-replay {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 43px;
  padding: 9px 17px;
  border: 1.5px solid rgba(255,255,255,.5);
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  color: #fff;
  font-size: .86rem;
  font-weight: 1000;
  transition: background .18s, transform .18s;
}

.game-result-replay:hover {
  background: rgba(255,255,255,.24);
  transform: translateY(-2px);
}

.game-result-confetti {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
}

.game-result-confetti i {
  position: absolute;
  top: -18px;
  left: var(--confetti-left);
  width: 8px;
  height: 15px;
  border-radius: 3px;
  background: #ffe45c;
  opacity: 0;
  animation: game-result-confetti-fall 1.65s ease-out forwards;
  animation-delay: var(--confetti-delay);
}

.game-result-confetti i:nth-child(3n) { background: #ff8a1f; }
.game-result-confetti i:nth-child(3n + 2) { background: #fff; }

@keyframes game-result-star-pop {
  65% { opacity: 1; transform: translateY(2px) rotate(8deg) scale(1.18); }
  100% { opacity: 1; transform: translateY(0) rotate(0) scale(1); }
}

@keyframes game-result-confetti-fall {
  0% { opacity: 0; transform: translateY(-10px) rotate(0); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translateY(250px) rotate(520deg); }
}

@keyframes game-result-logo-float {
  0%, 100% { transform: translateY(3px); }
  50% { transform: translateY(-6px); }
}

.auth-brand {
  display: block;
  width: auto;
  height: 68px;
  margin: 0 auto 14px;
}

.auth-heading {
  margin-bottom: 26px;
  text-align: center;
}

.auth-heading h1 {
  margin: 0 0 7px;
  color: var(--text);
  font: 400 clamp(1.55rem, 4vw, 2rem)/1.15 'Paytone One', system-ui;
}

.auth-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.auth-alert {
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid;
  border-radius: 13px;
  font-size: .9rem;
  line-height: 1.45;
}

.auth-alert.error {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fecaca;
}

.auth-alert.success {
  color: #32731a;
  background: #f0fce8;
  border-color: #b9e99d;
}

.auth-field {
  margin-bottom: 17px;
}

.auth-field label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: .77rem;
  font-weight: 800;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.auth-field input {
  width: 100%;
  min-height: 50px;
  padding: 12px 15px;
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 13px;
  outline: none;
  font: 600 1rem 'Nunito', system-ui;
  transition: border-color .2s, box-shadow .2s, background .2s;
}

.auth-field input:focus {
  background: #fff;
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(99, 184, 47, .13);
}

.auth-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  padding: 12px 20px;
  color: #fff;
  background: linear-gradient(135deg, var(--orange), #f59e0b);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 7px 20px rgba(249, 115, 22, .27);
  cursor: pointer;
  font: 400 1rem 'Paytone One', system-ui;
  text-decoration: none;
  transition: transform .18s, box-shadow .18s;
}

.auth-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(249, 115, 22, .36);
}

.auth-primary:disabled {
  cursor: wait;
  opacity: .72;
  transform: none;
}

.auth-secondary-link {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  text-align: center;
  line-height: 1.55;
}

.auth-secondary-link a {
  color: var(--green-d);
  font-weight: 900;
}

.signup-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, .92fr);
  gap: 30px;
  align-items: stretch;
}

.signup-pitch,
.signup-card {
  border: 1.5px solid var(--border);
  border-radius: 26px;
  box-shadow: 0 18px 55px rgba(47, 92, 25, .11);
}

.signup-pitch {
  position: relative;
  overflow: hidden;
  padding: clamp(34px, 5vw, 64px);
  color: #fff;
  background: linear-gradient(145deg, #326f1a, #63b82f 58%, #8bd653);
}

.signup-pitch::after {
  position: absolute;
  right: -80px;
  bottom: -100px;
  width: 310px;
  height: 310px;
  background: rgba(255, 255, 255, .1);
  border-radius: 50%;
  content: '';
}

.signup-kicker {
  display: inline-flex;
  margin-bottom: 19px;
  padding: 7px 13px;
  color: #285f13;
  background: #fff;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 1000;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.signup-pitch h1 {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0 0 16px;
  font: 400 clamp(2rem, 5vw, 3.6rem)/1.06 'Paytone One', system-ui;
}

.signup-pitch h1 span {
  color: #fff0a7;
}

.signup-lead {
  position: relative;
  z-index: 1;
  max-width: 610px;
  margin: 0;
  color: rgba(255, 255, 255, .92);
  font-size: clamp(1rem, 2vw, 1.13rem);
  line-height: 1.65;
}

.signup-benefits {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  margin: 31px 0 0;
  padding: 0;
  list-style: none;
}

.signup-benefits li {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 15px;
  backdrop-filter: blur(5px);
}

.signup-benefits i {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  background: rgba(255, 255, 255, .18);
  border-radius: 12px;
  font-style: normal;
  font-size: 1.18rem;
}

.signup-benefits strong {
  display: block;
  margin-bottom: 2px;
  font-size: .98rem;
}

.signup-benefits small {
  color: rgba(255, 255, 255, .78);
  line-height: 1.35;
}

.signup-card {
  padding: clamp(28px, 4vw, 42px);
  background: #fff;
}

.signup-card-header {
  margin-bottom: 23px;
}

.signup-card-header h2 {
  margin: 0 0 6px;
  color: var(--text);
  font: 400 1.55rem 'Paytone One', system-ui;
}

.signup-card-header p {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.5;
}

.signup-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.signup-reassurance {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 15px 0 0;
  color: var(--muted);
  font-size: .76rem;
  text-align: center;
}

.signup-consent {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin: 4px 0 19px;
  padding: 13px;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 13px;
  cursor: pointer;
  font-size: .82rem;
  line-height: 1.45;
}

.signup-consent input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--green);
  cursor: pointer;
}

.signup-consent:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(99, 184, 47, .11);
}

.signup-consent a {
  color: var(--green-d);
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.signup-login {
  margin-top: 22px;
  color: var(--muted);
  font-size: .88rem;
  text-align: center;
}

.signup-login button,
.signup-login a {
  padding: 0;
  color: var(--green-d);
  background: none;
  border: 0;
  cursor: pointer;
  font: 900 inherit;
  text-decoration: underline;
}

.signup-success {
  width: min(680px, 100%);
  margin: 0 auto;
  padding: clamp(30px, 6vw, 55px);
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 26px;
  box-shadow: 0 18px 55px rgba(47, 92, 25, .13);
  text-align: center;
}

.signup-success-icon {
  display: grid;
  width: 78px;
  height: 78px;
  margin: 0 auto 18px;
  place-items: center;
  background: var(--green-bg);
  border-radius: 50%;
  font-size: 2.2rem;
}

.signup-success h1 {
  margin: 0 0 10px;
  font: 400 clamp(1.65rem, 5vw, 2.25rem) 'Paytone One', system-ui;
}

.signup-success p {
  color: var(--muted);
  line-height: 1.6;
}

.signup-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 25px 0;
  padding: 0;
  list-style: none;
  counter-reset: signup-step;
}

.signup-steps li {
  padding: 14px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--muted);
  font-size: .82rem;
}

.signup-steps strong {
  display: block;
  color: var(--text);
  font-size: .88rem;
}

@media (max-width: 900px) {
  .game-end-login-layout {
    width: min(680px, 100%);
    grid-template-columns: 1fr;
  }

  .game-result-card {
    min-height: 0;
  }

  .game-end-signup-layout .signup-card {
    order: initial;
  }

  .signup-layout {
    grid-template-columns: 1fr;
    width: min(680px, 100%);
    margin: 0 auto;
  }

  .signup-pitch {
    padding: 38px 32px;
  }

  .signup-card {
    order: -1;
  }
}

@media (max-width: 600px) {
  .auth-page {
    padding: calc(var(--nav-h) + 20px) 12px 44px;
  }

  .login-card,
  .signup-card,
  .signup-pitch,
  .signup-success {
    padding: 26px 20px 28px;
    border-radius: 18px;
  }

  .game-result-card {
    padding: 24px 17px 27px;
    border-radius: 20px;
  }

  .game-result-logo {
    width: min(270px, 86%);
  }

  .game-result-logo img {
    height: 125px;
  }

  .game-result-score {
    width: min(290px, 100%);
  }

  .game-result-stars {
    gap: 1px;
  }

  .game-result-stars span {
    font-size: 1.65rem;
  }

  .auth-brand {
    height: 56px;
  }

  .signup-pitch h1 {
    font-size: 2rem;
  }

  .signup-benefits li {
    padding: 10px 11px;
  }

  .signup-reassurance {
    flex-direction: column;
    gap: 4px;
  }

  .signup-steps {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .game-result-logo img,
  .game-result-stars span,
  .game-result-confetti i {
    animation: none;
  }

  .game-result-stars span {
    opacity: 1;
    transform: none;
  }
}
