/* Native welcome dialog. The canvas owns the sparks outside the card. */
.y999-popup-open { overflow: hidden; }
dialog.y999-popup {
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  width: calc(100% - 48px);
  max-width: min(460px, max(280px, calc(100dvh - 248px)));
  height: fit-content;
  max-height: calc(100vh - 64px);
  max-height: calc(100dvh - 64px);
  margin: auto;
  padding: 0;
  overflow: visible;
  color: #e7f4ff;
  background: transparent;
  border: 0;
  outline: 0;
  isolation: isolate;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.y999-popup::backdrop {
  background: rgba(1, 7, 16, .79);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
}

.y999-popup[open] {
  animation: y999-popup-enter .26s cubic-bezier(.2, .8, .2, 1) both;
}

.y999-popup[open]::backdrop {
  animation: y999-popup-backdrop .26s ease-out both;
}

.y999-popup__card {
  box-sizing: border-box;
  position: relative;
  z-index: 1;
  max-height: calc(100vh - 64px);
  max-height: calc(100dvh - 64px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #55565c #17181c;
  color: #e7f4ff;
  background: #17181c;
  border: 1px solid rgba(116, 205, 246, .48);
  border-radius: 22px;
  box-shadow: 0 30px 100px rgba(0, 0, 0, .5), 0 0 45px rgba(53, 166, 224, .11);
  text-align: center;
}

canvas.y999-popup__sparks {
  position: absolute;
  z-index: 2;
  inset: -168px;
  display: block;
  pointer-events: none;
  user-select: none;
}

.y999-popup__hero {
  position: relative;
  padding: 0;
  background: #1c1c1c;
}

#y999-welcome img.y999-popup__logo {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1;
  margin: 0;
  padding: 0;
  object-fit: contain;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

body.ocean-interface #y999-welcome .y999-popup__close {
  box-sizing: border-box;
  position: absolute;
  z-index: 3;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0 !important;
  color: #f1ef26 !important;
  background: rgba(7, 8, 10, .8) !important;
  border: 1px solid rgba(241, 239, 38, .25) !important;
  border-radius: 50% !important;
  font-family: inherit;
  font-size: 27px;
  font-weight: 400 !important;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: none;
  box-shadow: none !important;
  cursor: pointer;
  transition: background-color .16s, border-color .16s, color .16s;
}

body.ocean-interface #y999-welcome .y999-popup__close:hover {
  color: #fff76b !important;
  background: #25262b !important;
  border-color: #f1ef26 !important;
}

.y999-popup__close svg {
  display: block;
  width: 20px;
  height: 20px;
  pointer-events: none;
}

.y999-popup__body {
  padding: 22px 22px 23px;
  background: radial-gradient(ellipse at 20% 0%, rgba(87, 89, 107, .19), transparent 75%), linear-gradient(145deg, #222329, #141519);
  border-top: 1px solid rgba(255, 255, 255, .045);
}

.y999-popup__actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

#y999-welcome .y999-popup__actions > a {
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 62px;
  padding: 15px 12px;
  border-radius: 14px;
  font-family: inherit;
  font-size: 18px;
  font-weight: 800;
  line-height: 22px;
  letter-spacing: .075em;
  text-transform: uppercase;
  text-decoration: none;
  text-shadow: none;
  transition: filter .16s, box-shadow .16s, transform .16s;
}

#y999-welcome .y999-popup__actions > a::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 25%, rgba(255, 255, 255, .22) 47%, transparent 67%);
  transform: translateX(-125%);
  transition: transform .55s ease;
  pointer-events: none;
}

#y999-welcome .y999-popup__actions > a:is(:hover, :focus-visible)::after {
  transform: translateX(125%);
}

#y999-welcome .y999-popup__login,
#y999-welcome .y999-popup__login:visited {
  color: #f1ef26 !important;
  background: linear-gradient(135deg, #464853, #25262e 55%, #17181e);
  border: 1px solid #4a4c58;
  box-shadow: 0 8px 0 #07080c, inset 0 1px 0 rgba(255, 255, 255, .18), 0 11px 20px rgba(0, 0, 0, .25);
}

#y999-welcome .y999-popup__register,
#y999-welcome .y999-popup__register:visited {
  color: #101108 !important;
  background: linear-gradient(135deg, #fff552, #f1ef20 55%, #e8e71b);
  border: 1px solid #f9f358;
  box-shadow: 0 8px 0 #07080c, inset 0 1px 0 rgba(255, 255, 255, .42), 0 11px 22px rgba(0, 0, 0, .3);
}

#y999-welcome .y999-popup__login:hover {
  color: #fff76b !important;
  filter: brightness(1.12);
  transform: translateY(-2px);
}

#y999-welcome .y999-popup__register:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
}

#y999-welcome .y999-popup__actions > a:active {
  transform: translateY(5px);
  box-shadow: 0 3px 0 #07080c, inset 0 1px 0 rgba(255, 255, 255, .18);
}

body.ocean-interface #y999-welcome :is(a, button):focus-visible {
  outline: 3px solid #c6f3ff;
  outline-offset: 4px;
}

#y999-welcome .y999-popup__caption {
  margin: 26px 0 0;
  color: #c5c6d0;
  font-size: 11px;
  line-height: 17px;
  text-wrap: balance;
}

#y999-welcome .y999-popup__copyright {
  margin: 7px 0 0;
  color: #efed44;
  font-size: 11px;
  line-height: 16px;
}

@keyframes y999-popup-enter {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes y999-popup-backdrop {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 560px) {
  .y999-popup__body { padding: 20px 18px 20px; }
  .y999-popup__actions { gap: 14px; }
  #y999-welcome .y999-popup__actions > a { min-height: 56px; padding-inline: 10px; font-size: 16px; }
  #y999-welcome .y999-popup__caption { font-size: 10px; }
}

@media (max-height: 700px) {
  .y999-popup__body { padding-bottom: 20px; }
  #y999-welcome .y999-popup__caption { margin-top: 23px; }
}

@media (prefers-reduced-motion: reduce) {
  .y999-popup[open], .y999-popup[open]::backdrop { animation: none; }
  #y999-welcome .y999-popup__actions > a,
  #y999-welcome .y999-popup__actions > a::after,
  body.ocean-interface #y999-welcome .y999-popup__close { transition: none; }
}

@media print {
  dialog.y999-popup,
  dialog.y999-popup[open],
  .y999-popup__sparks { display: none !important; }
  .y999-popup::backdrop { display: none; background: transparent; }
}
