/* Account entry: shared by the native homepage dialog and legacy page overlays. */
#authModalOverlay.auth-experience {
  --auth-ink: #f3f8ff;
  --auth-soft: #b9ccde;
  --auth-line: #35536c;
  --auth-mint: #76ecd2;
  color: var(--auth-ink);
  background: #020b17c7;
  padding: 12px;
  backdrop-filter: blur(8px);
}
dialog#authModalOverlay.auth-experience {
  display: block;
  width: min(496px, calc(100% - 24px));
  height: fit-content;
  max-width: none;
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 26px;
  background: transparent;
  overflow: visible;
}
dialog#authModalOverlay.auth-experience:not([open]),
#authModalOverlay.auth-experience[hidden],
#authModalOverlay.auth-experience [hidden] { display: none !important; }
dialog#authModalOverlay.auth-experience::backdrop { background: #020b17c7; backdrop-filter: blur(8px); }
#authModalOverlay.auth-experience .auth-modal {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  width: min(496px, 100%);
  max-height: calc(100dvh - 24px);
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #587b99;
  border-radius: 26px;
  background: radial-gradient(ellipse at 12% 0%, #1c4262 0, transparent 53%), #0c1d31;
  box-shadow: 0 24px 100px #000a, 0 0 0 5px #70c9ff08;
}
#authModalOverlay .auth-modal::before {
  content: '';
  position: absolute;
  z-index: 2;
  inset: 0 36px auto;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, #76ecd2, #9bafff, #ffd166);
  pointer-events: none;
}
#authModalOverlay .auth-modal-toolbar {
  position: absolute;
  z-index: 5;
  top: 12px;
  right: 12px;
  padding: 0;
}
#authModalOverlay .auth-modal-close {
  width: 44px;
  height: 44px;
  min-height: 44px;
  border: 1px solid #56728b;
  border-radius: 13px;
  background: #112941;
  color: #d6e7f3;
  font-size: 26px;
}
#authModalOverlay .auth-modal-close:hover { background: #22435d; color: #fff; }
#authModalOverlay .auth-modal-body {
  min-width: 0;
  min-height: 0;
  padding: 28px 26px 22px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #47657d transparent;
}
#authModalOverlay .auth-welcome { display: flex; align-items: center; gap: 14px; padding-right: 32px; margin-bottom: 22px; }
#authModalOverlay .auth-mascot { flex: 0 0 68px; width: 68px; height: 78px; color: #83bbdc; }
#authModalOverlay .auth-mascot svg { width: 100%; height: 100%; }
#authModalOverlay .auth-welcome-copy { min-width: 0; }
#authModalOverlay .auth-eyebrow { display: block; margin: 0 0 6px; color: var(--auth-mint); font-size: 10px; font-weight: 850; letter-spacing: .14em; line-height: 1.2; }
#authModalOverlay .auth-welcome h2 { margin: 0; color: var(--auth-ink); font-size: clamp(21px, 5.2vw, 26px); line-height: 1.12; letter-spacing: -.035em; font-weight: 850; text-wrap: balance; }
#authModalOverlay .auth-intro { margin: 8px 0 0; color: var(--auth-soft); font-size: 13px; line-height: 1.45; }
#authModalOverlay .auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 0 0 20px; padding: 5px; border: 1px solid #34536b; border-radius: 16px; background: #061524; }
#authModalOverlay .auth-tab { min-height: 46px; padding: 10px 8px; border: 0; border-radius: 11px; background: transparent; color: #bdd0e0; font: inherit; font-size: 14px; line-height: 1.35; font-weight: 800; cursor: pointer; }
#authModalOverlay .auth-tab:hover { color: #fff; background: #18354a; }
#authModalOverlay .auth-tab.active { background: #d6fff4; color: #103c35; box-shadow: 0 2px 7px #0003; }
#authModalOverlay .auth-tab:disabled { opacity: .65; cursor: wait; }
#authModalOverlay .auth-form { margin: 0; }
#authModalOverlay .auth-form label { display: block; margin: 0 0 15px; color: #dfebf5; font-size: 14px; font-weight: 700; line-height: 1.45; }
#authModalOverlay .auth-form :is(input:not([type=checkbox]), select) {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 50px;
  margin: 7px 0 0;
  padding: 12px 14px;
  border: 1px solid #54718a;
  border-radius: 13px;
  outline: none;
  background: #0a1a2c;
  color: #f3f8ff;
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: inset 0 1px 3px #0002;
}
#authModalOverlay .auth-form input::placeholder { color: #90a8bd; opacity: 1; }
#authModalOverlay .auth-form :is(input:not([type=checkbox]), select):focus { border-color: #83eed9; box-shadow: 0 0 0 3px #76ecd225; }
#authModalOverlay .auth-form input[aria-invalid=true] { border-color: #ffa4b2; }
#authModalOverlay .auth-field-group { margin: 0 0 15px; }
#authModalOverlay .auth-field-group > label { margin-bottom: 0; }
#authModalOverlay .auth-password-field { position: relative; display: block; margin-top: 7px; }
#authModalOverlay .auth-password-field input { margin-top: 0; padding-right: 76px; }
#authModalOverlay .auth-password-toggle {
  position: absolute;
  top: 3px;
  right: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  min-height: 44px;
  padding: 5px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #b6f7e9;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
#authModalOverlay .auth-password-toggle:hover { background: #1b3b4b; }
#authModalOverlay .auth-field-hint { display: block; margin: 7px 0 0; color: #b3c7d9; font-size: 12px; font-weight: 400; line-height: 1.4; }
#authModalOverlay .auth-age-note { margin: 0 0 16px; padding: 11px 13px; border-left: 3px solid #a99bff; border-radius: 0 10px 10px 0; background: #a99bff0b; color: #cbd9e7; font-size: 13px; line-height: 1.5; }
#authModalOverlay .auth-safety-step label { gap: 0; }
#authModalOverlay .auth-safety-step select { color-scheme: dark; padding-right: 30px; }
#authModalOverlay .auth-safety-fields { display: block; min-width: 0; margin: 0; padding: 0; border: 0; }
#authModalOverlay .auth-form label.auth-consent { display: grid !important; grid-template-columns: 20px minmax(0, 1fr); align-items: start; gap: 11px; margin: 18px 0; color: #c3d5e3; font-size: 12px; line-height: 1.55; font-weight: 400; }
#authModalOverlay .auth-consent input[type=checkbox] { display: block; width: 20px; height: 20px; min-height: 20px; margin: 2px 0 0; padding: 0; accent-color: #76ecd2; }
#authModalOverlay .auth-consent a, #authModalOverlay .auth-guest-guidance a { color: #c4c8ff; text-decoration: underline; text-underline-offset: 3px; }
#authModalOverlay .auth-guest-guidance { margin: 0 0 4px; padding: 14px; border: 1px solid #4c8d85; border-radius: 13px; background: #163d3a; color: #e0fff8; font-size: 14px; line-height: 1.55; }
#authModalOverlay .auth-error, #authModalOverlay .auth-success { margin: 0 0 15px; padding: 12px 14px; border: 1px solid #a55a6b; border-radius: 12px; background: #542b3b; color: #ffe1e6; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
#authModalOverlay .auth-success { border-color: #4e8a7e; background: #163c35; color: #d4fff0; }
#authModalOverlay .auth-error::before { content: '!'; display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: 7px; border: 1px solid #ffc2d0; border-radius: 50%; color: #fff1f4; font-size: 12px; line-height: 1; font-weight: 850; vertical-align: text-bottom; }
#authModalOverlay .auth-error:empty { display: none; }
#authModalOverlay .auth-info { margin: 0 0 15px; padding: 12px 14px; border: 1px solid #598da5; border-radius: 12px; background: #123947; color: #d9f8ff; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
#authModalOverlay .auth-info a { color: #adf9e7; text-decoration: underline; text-underline-offset: 3px; }
#authModalOverlay .auth-info:empty { display: none; }
#authModalOverlay .auth-submit { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 50px; padding: 13px 18px; border: 1px solid #90f6df; border-radius: 14px; background: #76ecd2; color: #073b31; box-shadow: 0 4px 0 #225f55; font: inherit; font-size: 15px; font-weight: 850; line-height: 1.4; cursor: pointer; transition: transform .15s ease, background .15s ease; }
#authModalOverlay .auth-submit:hover:not(:disabled) { background: #a4f9e6; filter: none; transform: translateY(-1px); }
#authModalOverlay .auth-submit:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 2px 0 #225f55; }
#authModalOverlay .auth-submit:disabled { background: #456c69; border-color: #658e88; color: #deeeeb; box-shadow: none; cursor: wait; }
#authModalOverlay :is(form[aria-busy=true] .auth-submit, .auth-submit[aria-busy=true])::before { content: ''; flex-shrink: 0; width: 15px; height: 15px; margin-right: 10px; border: 2px solid #deeeeb55; border-top-color: #f0fff9; border-radius: 50%; animation: auth-button-spin .75s linear infinite; }
@keyframes auth-button-spin { to { transform: rotate(360deg); } }
#authModalOverlay .auth-guest-footer { flex-shrink: 0; padding: 17px 26px 16px; border-top: 1px solid #324b63; background: #091729; }
#authModalOverlay .auth-guest-play { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 48px; padding: 11px 15px; border: 1px solid #5e7b93; border-radius: 14px; background: #142c42; color: #f0f8ff; text-decoration: none; font-size: 15px; line-height: 1.4; font-weight: 800; }
#authModalOverlay .auth-guest-play svg { flex-shrink: 0; width: 18px; height: 18px; fill: #76ecd2; }
#authModalOverlay .auth-guest-arrow { margin-left: auto; color: #b7d7e8; font-size: 20px; line-height: 1; }
#authModalOverlay .auth-guest-play:hover { background: #203f57; border-color: #9cbdd3; }
#authModalOverlay .auth-guest-footer p { margin: 9px 0 0; color: #b5c9d9; font-size: 11px; line-height: 1.4; text-align: center; }
#authModalOverlay .auth-guest-path .auth-guest-play { border-color: #79ecd1; background: #164337; color: #e0fff4; }
#authModalOverlay :is(a,button,input,select):focus-visible { outline: 3px solid #ffd166; outline-offset: 3px; }
@media (max-width: 480px) {
  #authModalOverlay.auth-experience .auth-modal { border-radius: 22px; }
  #authModalOverlay .auth-modal-body { padding: 26px 20px 20px; }
  #authModalOverlay .auth-welcome { gap: 10px; padding-right: 40px; margin-bottom: 20px; }
  #authModalOverlay .auth-mascot { flex-basis: 54px; width: 54px; height: 65px; }
  #authModalOverlay .auth-eyebrow { font-size: 9px; }
  #authModalOverlay .auth-intro { font-size: 12px; }
  #authModalOverlay .auth-guest-footer { padding: 15px 20px 14px; }
}
@media (max-width: 350px) {
  #authModalOverlay .auth-modal-body { padding-inline: 16px; }
  #authModalOverlay .auth-welcome { padding-right: 40px; gap: 8px; }
  #authModalOverlay .auth-mascot { flex-basis: 43px; width: 43px; }
  #authModalOverlay .auth-welcome h2 { font-size: 20px; }
  #authModalOverlay .auth-guest-footer { padding-inline: 16px; }
  #authModalOverlay .auth-tab { font-size: 13px; }
}
@media (max-height: 560px) and (min-width: 560px) {
  #authModalOverlay .auth-modal-body { padding-top: 20px; }
  #authModalOverlay .auth-welcome { margin-bottom: 14px; }
  #authModalOverlay .auth-mascot { height: 54px; }
  #authModalOverlay .auth-guest-footer { padding-block: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  #authModalOverlay *, #authModalOverlay *::before { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}


/* Compact account home. Old page-specific popover styles cannot hide this on phones. */
#authAccountPanel.account-space-menu {
  position: fixed; inset: 80px 20px auto auto; margin: 0; padding: 18px;
  width: min(392px, calc(100vw - 24px)); max-width: none;
  max-height: calc(100dvh - 104px); overflow: auto; overscroll-behavior: contain;
  border: 1px solid #35556b; border-radius: 22px; background: #0c2132; color: #edf7ff;
  box-shadow: 0 24px 80px #0008; text-align: left; box-sizing: border-box;
  font-family: inherit; z-index: 1000;
}
dialog#authAccountPanel.account-space-menu:not([open]) { display: none; }
dialog#authAccountPanel.account-space-menu[open] { display: block; }
#authAccountPanel.account-space-menu::backdrop { background: #020b179c; backdrop-filter: blur(5px); }
.account-space-menu [hidden] { display: none !important; }
.account-space-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#authAccountPanel .account-space-heading h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
#authAccountPanel .account-space-heading button { width: 44px; height: 44px; min-height: 44px; padding: 0; border: 1px solid #3e5b70; border-radius: 13px; color: #c9dce8; background: transparent; font-size: 25px; cursor: pointer; }
.account-space-identity { display: flex; align-items: center; gap: 10px; padding: 12px 0 16px; }
.account-space-identity img { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 14px; object-fit: cover; background: #163448; }
.account-space-identity > div { min-width: 0; flex: 1; }
.account-space-identity strong { display: block; font-size: 16px; line-height: 1.4; overflow-wrap: anywhere; }
.account-space-menu small { display: block; font-size: 12px; line-height: 1.5; color: #adcad9; }
#authAccountPanel .account-space-edit { flex: 0 0 auto; max-width: 100px; padding: 8px; min-height: 44px; display: inline-flex; align-items: center; border: 0; background: transparent; color: #83efd4; font: inherit; font-size: 12px; text-decoration: none; cursor: pointer; }
.account-space-links { display: grid; gap: 3px; border-top: 1px solid #2b485d; padding: 8px 0; }
.account-space-links > a { display: flex; gap: 12px; align-items: center; min-height: 62px; padding: 8px; border-radius: 12px; text-decoration: none; color: inherit; }
.account-space-links > a > span:nth-child(2) { flex: 1; min-width: 0; }
.account-space-links strong { display: block; font-size: 15px; font-weight: 650; line-height: 1.5; }
.account-space-icon { flex: 0 0 32px; width: 32px; height: 32px; display: grid; place-items: center; color: #85eed6; font-size: 22px; background: #163548; border-radius: 10px; }
.account-space-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 8px; border-top: 1px solid #2b485d; }
#authAccountPanel .account-space-footer > * { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px; border: 0; color: #c1d6e4; background: transparent; font: inherit; font-size: 14px; text-decoration: none; cursor: pointer; }
#authAccountPanel #accountSpaceSignIn { color: #83efd4; margin-left: auto; }
#authAccountPanel .account-space-return { display: flex; gap: 12px; padding: 12px; margin-bottom: 10px; border: 1px solid #3c776f; border-radius: 14px; text-decoration: none; color: #edf7ff; background: #143737; }
.account-space-return img { width: 64px; height: 48px; object-fit: cover; border-radius: 9px; }
.account-space-return > span { min-width: 0; }
.account-space-return strong { display: block; font-size: 14px; overflow-wrap: anywhere; }
.account-space-return > span > span { color: #91f6dc; font-size: 12px; }
#authAccountPanel a:hover, #authAccountPanel button:hover { background-color: #1a3b4e; }
#authAccountPanel :focus-visible { outline: 3px solid #a5ffdf; outline-offset: 2px; }
@media (max-width: 700px) {
  #authAccountPanel.account-space-menu { inset: auto 0 0; margin: 0; width: 100%; max-height: calc(100dvh - 12px); border-radius: 22px 22px 0 0; padding: 14px 16px max(12px, env(safe-area-inset-bottom)); }
  .account-space-heading { position: sticky; top: -14px; z-index: 1; padding-top: 3px; background: #0c2132; }
  .account-space-links > a { min-height: 58px; padding-block: 7px; }
}
@media (prefers-reduced-motion: reduce) { .account-space-menu *, .my-space-page * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
