.password-label {
  font-weight: 700;
  color: var(--pine);
}
.signin-password {
  position: relative;
  min-width: 0;
}
.signin-password input, #game-entry .signin-password input {
  display: block;
  width: 100%;
  padding-right: 3.25rem;
}
.signin-password input::-ms-reveal { display: none; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 2px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--pine);
}
.password-toggle:hover { background: #e8eee6; }
.password-toggle:focus-visible { outline-offset: -3px; }
.password-toggle .eye-slash { display: none; }
.signin-password input[type=text] + .password-toggle .eye-slash { display: inline; }
.signin-password-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0 .75rem;
}
.signin-recovery {
  color: var(--pine);
  font-size: .875rem;
  font-weight: 500;
  text-underline-offset: 3px;
}
.signin-auth {
  --register-red: var(--berry, #ac2340);
  padding: 12px var(--auth-inset, 0) 24px;
}
.signin-modes {
  margin: 0 0 .85rem;
  min-width: 0;
  padding: 0;
  border: 0;
}
.signin-switch {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 4px;
  border-radius: 999px;
  background: #e6e2d6;
}
.signin-switch::before {
  content: '';
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: 999px;
  background: var(--pine);
}
.signin-switch label { position: relative; cursor: pointer; }
.signin-switch input, #game-entry .signin-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}
.signin-switch span {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: .35rem;
  border-radius: 999px;
  color: var(--pine);
  font-weight: 650;
}
.signin-switch input[value=register] + span { color: var(--register-red); }
.signin-switch input:checked + span { color: #fffefa; }
.signin-switch input:focus-visible + span { outline: 3px solid #d28b16; outline-offset: 2px; }
.signin-credentials[data-mode=register] .signin-switch::before {
  transform: translateX(100%);
  background: var(--register-red);
}
.signin-credentials[data-mode=register] .signin-recovery { visibility: hidden; }
@media (prefers-reduced-motion: no-preference) {
  .signin-switch::before {
    transition: transform 230ms cubic-bezier(.22,.75,.2,1), background-color 200ms;
  }
}

.portal-dialog {
  box-sizing: border-box;
  max-height: calc(100dvh - 24px);
  margin: auto;
  border: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
html:has(.portal-dialog[open]) { overflow: hidden; }
.portal-dialog > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding-inline-end: 12px;
}
.portal-dialog .dialog-close {
  display: grid;
  place-items: center;
  flex: none;
  padding: 0;
  border-radius: 50%;
  font: 500 1.4rem/1 "Golos Text", Arial, sans-serif;
  cursor: pointer;
}

.auth:has(.signin-auth) {
  display: block;
  width: min(31.5rem, calc(100% - 1.5rem));
  margin-inline: auto;
  padding-block: clamp(1.25rem, 5vw, 3.5rem);
}
.auth:has(.signin-auth) .auth-art { display: none; }
.auth-view:has(.signin-auth), #game-entry:has(.signin-auth),
.portal-dialog {
  --auth-paper: var(--curve-base, #f8f2e8);
  --auth-inset: clamp(20px, 5vw, 32px);
  --auth-type: var(--sans, "Golos Text", Arial, sans-serif);
  --auth-display: var(--display, "Rubik", Arial, sans-serif);
  padding: 0;
  background: var(--auth-paper);
  color: var(--ink);
  font-family: var(--auth-type);
  border-radius: 20px;
  box-shadow: 0 14px 54px #082f3238;
}
.auth-view:has(.signin-auth) { overflow: hidden; }
#game-entry:has(.signin-auth),
.portal-dialog {
  width: min(31.5rem, calc(100% - 1.5rem));
  box-shadow: 0 20px 70px #031b1ad9;
}
#game-entry:has(.signin-auth)::backdrop,
.portal-dialog::backdrop {
  background: rgb(5 29 26 / 72%);
  backdrop-filter: blur(5px);
}
.entry-card:has(.signin-auth) { padding: 0; }
:is(.auth-view, .entry-card):has(.signin-auth) > .entry-heading,
.portal-dialog > header {
  padding: clamp(14px, 3vh, 20px) var(--auth-inset);
  background: #123f38;
}
.entry-card:has(.signin-auth) > .entry-heading { padding-right: 64px; }
.auth-view:has(.signin-auth) h1, .entry-card:has(.signin-auth) #entry-title,
.portal-dialog > header h2 {
  margin: 0;
  color: #fffefa;
  font: 800 clamp(1.9rem, 5vw, 2.45rem)/1.13 var(--auth-display);
  letter-spacing: -.043em;
}
:is(.entry-card, .auth-view):has(.signin-auth) .entry-heading em,
.portal-dialog > header em {
  margin-inline-start: .055em;
  color: var(--gold, #ffd58b);
  font: 400 1.08em/0 var(--script, "Lobster", Georgia, serif);
  letter-spacing: -.012em;
}
.entry-card:has(.signin-auth) #entry-close,
.portal-dialog .dialog-close {
  top: clamp(10px, 2vh, 18px);
  right: 8px;
  width: 44px;
  height: 44px;
  background: #103c33c9;
  border: 1px solid #fff4df80;
  color: #fff4df;
}
.entry-card:has(.signin-auth) #entry-close:hover, .portal-dialog .dialog-close:hover { background: #104b42; }
.auth-view .signin-auth .field, #game-entry .signin-auth .field {
  gap: 5px;
  margin: .72rem 0;
  color: var(--ink);
  font: 600 .94rem/1.35 var(--auth-type);
}
.auth-view .signin-fields input, #game-entry .signin-fields input {
  border: 1px solid #98a79b;
  background: #fffefa;
  border-radius: 9px;
  font: 400 1rem/1.35 var(--auth-type);
  color: var(--ink);
}
.signin-auth .form-actions { margin-top: .9rem; }
.auth-view .signin-auth .primary, #game-entry .signin-auth .primary,
.review-form .review-send {
  min-height: 48px;
  background: var(--gold, #ffd58b);
  border: 0;
  color: var(--deep, #082f32);
  border-radius: 9px;
  box-shadow: inset 0 1px #fff3d4, 0 2px #9c6834;
  font: 800 1.1rem/1.2 var(--display, "Rubik", Arial, sans-serif);
}
.auth-view .signin-auth .primary:hover, #game-entry .signin-auth .primary:hover,
.review-form .review-send:hover:not(:disabled) { background: #ffe0aa; }
.auth-view .signin-credentials[data-mode=register] .primary, #game-entry .signin-credentials[data-mode=register] .primary {
  background: var(--register-red);
  color: #fffefa;
  box-shadow: inset 0 1px #d96779, 0 2px #731d30;
}
.auth-view .signin-credentials[data-mode=register] .primary:hover, #game-entry .signin-credentials[data-mode=register] .primary:hover {
  background: var(--cherry, #991f3b);
}
.signin-auth .primary:active { transform: translateY(1px); }
.signin-auth .signin-provider-label {
  margin: 0 0 .55rem;
  color: var(--pine);
  font-weight: 650;
}
.signin-divider {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin: 1.15rem 0 .6rem;
  color: #505e54;
  font-size: .88rem;
}
.signin-divider::before, .signin-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid #cbc9b9;
}
.signin-providers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .5rem;
  margin: 0;
}
.auth-view .signin-providers .btn, #game-entry .signin-providers .btn, #recovery .signin-providers .btn {
  min-height: 44px;
  padding: .5rem .35rem;
  gap: .45rem;
  min-width: 0;
  overflow-wrap: anywhere;
  border: 1px solid #acb7aa;
  border-radius: 10px;
  color: var(--pine);
  background: #fffefa;
  font: 600 clamp(.8125rem, 2.5vw, .95rem)/1.25 var(--auth-type);
}
.auth-view .signin-providers .btn:hover, #game-entry .signin-providers .btn:hover, #recovery .signin-providers .btn:hover {
  background: #f0f3e8;
  border-color: var(--pine);
}
.signin-providers img { width: 21px; height: 21px; flex: none; }
@media (max-width: 350px) {
  .signin-auth .signin-providers { grid-template-columns: 1fr; }
}

.practice-signin-note { padding:.85rem 1rem; border:1px solid #c8b47e; border-radius:12px; color:#173e35; background:#fff4d6; }
#game-entry .practice-signin-note p { margin:.3rem 0; font-size:.94rem; line-height:1.35; }
.practice-methods { display:flex; flex-wrap:wrap; gap:.45rem; margin-top:.55rem; }
#game-entry .practice-methods button { min-height:44px; padding:.45rem .7rem; border:1px solid #86a699; border-radius:9px; color:#104b42; background:#fffefa; font:inherit; font-weight:700; cursor:pointer; }
#game-entry .practice-methods button[aria-pressed=true] { color:#fffefa; background:#104b42; }

#game-entry:has(.purchase-card), .portal-dialog.purchase-dialog {
  width: min(30rem, calc(100% - 1.5rem));
  max-width: none;
  background: #fffcf4;
  border-radius: 22px;
  box-shadow: 0 24px 80px #061d1a55;
}
.purchase-dialog::backdrop { background: rgb(9 26 22 / 65%); backdrop-filter: blur(4px); }
.purchase-card:focus { outline: none; }
.purchase-card {
  position: relative;
  padding: clamp(24px, 5vw, 36px);
  border-radius: 22px;
  background: #fffcf4;
  color: #143a35;
  text-align: center;
  font: 400 1rem/1.5 "Golos Text", Arial, sans-serif;
}
main > .purchase-card {
  width: min(30rem, calc(100% - 1.5rem));
  margin: clamp(24px, 6vw, 64px) auto;
  box-shadow: 0 12px 40px #061d1a18;
}
.purchase-card #purchase-title {
  margin: 0 28px 1.2rem;
  color: #104b42;
  font: 800 clamp(1.7rem, 5vw, 2.45rem)/1.1 "Rubik", Arial, sans-serif;
  letter-spacing: -.043em;
}
.purchase-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #104b42;
  font: 500 1.4rem/1 "Golos Text", Arial, sans-serif;
  cursor: pointer;
}
.purchase-close:hover { background: #f1ede2; }
.purchase-card p { margin: 0; text-wrap: pretty; }
.purchase-card .purchase-notice { margin-bottom: .85rem; font-weight: 600; }
.purchase-card .purchase-offer {
  margin-top: .5rem;
  color: #506159;
  font-size: .9rem;
}
.purchase-offer a { color: #104b42; text-decoration: underline; text-underline-offset: .15em; }
.purchase-pay {
  display: block;
  max-width: 100%;
  min-height: 48px;
  margin: 1.4rem auto 0;
  padding: .7rem clamp(.75rem, 3vw, 1.35rem);
  border: 0;
  border-radius: 10px;
  color: white;
  background: #104b42;
  font: 700 1rem/1.35 "Golos Text", Arial, sans-serif;
  cursor: pointer;
}
.purchase-pay:hover:not(:disabled) { background: #0c4038; }
.purchase-pay:disabled { opacity: .7; cursor: wait; }
.purchase-card .error-msg { margin-top: .8rem; color: #8c2033; }
