.auth-page-wrapper {
  min-height: 100vh;
}

.auth-header {
  position: relative;
  z-index: 3;
}

.auth-header-links {
  display: flex;
  align-items: center;
  gap: 18px;
}

.auth-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  transition: color var(--transition-fast);
}

.auth-back-link:hover {
  color: var(--color-primary-light);
}

.auth-back-link svg {
  color: var(--color-primary);
}

.auth-page {
  flex: 1;
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 48px 20px 64px;
  background: var(--bg-body);
}

.auth-background,
.auth-background-shade {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: -1;
}

.auth-background .hero-background {
  background-position: center 48%;
}

.auth-background-shade {
  background: var(--overlay-auth);
}

.auth-card {
  --auth-card-glow: var(--color-primary-subtle);
  width: min(100%, 470px);
  position: relative;
  overflow: hidden;
  padding: 34px 38px 27px;
  border: 1px solid var(--border-auth-primary);
  border-radius: var(--radius-xl);
  background: var(--surface-panel);
  box-shadow: 0 28px 80px var(--shadow-auth-card), 0 0 42px var(--auth-card-glow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: auth-card-enter 420ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  transition: border-color var(--transition-slow), box-shadow var(--transition-slow);
}

.auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 38px;
  width: 78px;
  height: 2px;
  background: linear-gradient(90deg, var(--transparent), var(--color-primary), var(--transparent));
  box-shadow: 0 0 15px var(--color-primary-glow);
  transition: width var(--transition-slow), left var(--transition-slow);
}

.auth-card.is-registering {
  --auth-card-glow: var(--color-primary-subtle);
  border-color: var(--border-auth-primary-strong);
}

.auth-card.is-registering::before {
  left: calc(100% - 116px);
  width: 78px;
}

@keyframes auth-card-enter {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.99);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.auth-card-topline {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text-dim);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.55px;
}

.auth-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-status-green);
  box-shadow: 0 0 10px var(--color-status-green-glow);
}

.auth-heading {
  margin-top: 25px;
}

.auth-eyebrow {
  margin-bottom: 8px;
  color: var(--color-primary);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.7px;
}

.auth-heading h1 {
  font-size: clamp(25px, 6vw, 32px);
  line-height: 1.15;
}

.auth-heading h1 span {
  color: var(--color-primary);
}

.auth-description {
  margin-top: 9px;
  font-size: 13px;
  line-height: 1.6;
}

.auth-heading.is-changing > * {
  animation: auth-copy-enter 220ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.auth-heading.is-changing > :nth-child(2) {
  animation-delay: 35ms;
}

.auth-heading.is-changing > :nth-child(3) {
  animation-delay: 70ms;
}

@keyframes auth-copy-enter {
  from {
    opacity: 0.35;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin: 25px 0 22px;
  padding: 4px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-auth-tabs);
}

.auth-tabs::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 6.5px);
  border: 1px solid var(--border-auth-primary);
  border-radius: var(--radius-sm);
  background: var(--surface-auth-tab-active);
  box-shadow: 0 2px 12px var(--shadow-auth-tab);
  transition: transform 280ms cubic-bezier(0.2, 0.75, 0.25, 1);
}

.auth-card.is-registering .auth-tabs::before {
  transform: translateX(calc(100% + 5px));
}

.auth-tab {
  position: relative;
  z-index: 1;
  min-height: 39px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  transition: color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.auth-tab:hover {
  color: var(--text-white);
}

.auth-tab:focus-visible,
.auth-password-toggle:focus-visible,
.auth-back-link:focus-visible,
.auth-forgot-link:focus-visible,
.auth-checkbox a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

.auth-tab.is-active {
  color: var(--text-white);
}

.auth-form-stage {
  overflow: hidden;
  transition: height 280ms cubic-bezier(0.2, 0.75, 0.25, 1);
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-form.is-entering > * {
  animation: auth-field-enter 320ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.auth-form.is-entering > :nth-child(2) {
  animation-delay: 25ms;
}

.auth-form.is-entering > :nth-child(3) {
  animation-delay: 50ms;
}

.auth-form.is-entering > :nth-child(4) {
  animation-delay: 75ms;
}

.auth-form.is-entering > :nth-child(5) {
  animation-delay: 100ms;
}

@keyframes auth-field-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-form[hidden] {
  display: none;
}

.auth-social {
  margin-top: 22px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-dim);
  font-size: 10px;
  white-space: nowrap;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--border-auth);
}

.auth-social-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.auth-social-button {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--border-auth);
  border-radius: var(--radius-md);
  background: var(--surface-auth-social);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  transition: border-color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

.auth-social-button:not(:disabled):hover {
  transform: translateY(-1px);
  border-color: var(--border-auth-hover);
  background: var(--surface-auth-social-hover);
}

.auth-social-button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.auth-social-button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

.auth-social-button svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
}

.auth-social-button--discord svg {
  color: var(--color-social-discord);
}

.auth-social-button--tiktok svg {
  color: var(--text-primary);
  filter: drop-shadow(1px 0 var(--color-social-tiktok-red)) drop-shadow(-1px 0 var(--color-social-tiktok-cyan));
}

.auth-social-button--telegram {
  position: relative;
  overflow: hidden;
}

.auth-telegram-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  pointer-events: none;
}

.auth-telegram-widget {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  opacity: 0.01;
}

.auth-telegram-widget iframe {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
}

.auth-social-button--telegram.is-disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.auth-social-button--telegram.is-disabled .auth-telegram-widget {
  display: none;
}

.auth-field {
  display: grid;
  gap: 7px;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
}

.auth-field > input,
.auth-password-wrap {
  width: 100%;
  min-height: 45px;
  border: 1px solid var(--border-auth);
  border-radius: var(--radius-md);
  background: var(--surface-auth-field);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

.auth-field > input,
.auth-password-wrap input {
  padding: 0 13px;
  color: var(--text-white);
  font-size: 13px;
}

.auth-field > input::placeholder,
.auth-password-wrap input::placeholder {
  color: var(--color-placeholder);
}

.auth-field > input:focus,
.auth-password-wrap:focus-within {
  border-color: var(--color-primary-border-strong);
  background: var(--surface-auth-field-focus);
  box-shadow: 0 0 0 3px var(--color-primary-subtle);
  transform: translateY(-1px);
}

.auth-password-wrap {
  display: flex;
  align-items: center;
}

.auth-password-wrap input {
  min-width: 0;
  flex: 1;
  height: 43px;
}

.auth-tabs[hidden] {
  display: none;
}

.auth-password-wrap input[type="password"]::-ms-reveal,
.auth-password-wrap input[type="password"]::-ms-clear {
  display: none;
}

.auth-password-toggle {
  flex: 0 0 auto;
  padding: 8px 12px;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  transition: color var(--transition-fast);
}

.auth-password-toggle:hover {
  color: var(--color-primary-light);
}

.auth-form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: -1px;
}

.auth-forgot-link {
  color: var(--color-primary-light);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  text-underline-offset: 3px;
}

.auth-forgot-link:hover {
  color: var(--text-white);
  text-decoration: underline;
}

.auth-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.5;
  cursor: pointer;
}

.auth-checkbox input {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  margin-top: 1px;
  accent-color: var(--color-primary);
}

.auth-checkbox a {
  color: var(--color-primary-light);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-submit {
  position: relative;
  width: 100%;
  min-height: 47px;
  justify-content: center;
  margin-top: 2px;
  font-size: 13px;
  text-transform: uppercase;
}

.auth-submit svg {
  position: absolute;
  right: 14px;
}

.auth-feedback {
  margin-top: 15px;
  padding: 11px 12px;
  border: 1px solid var(--color-primary-border);
  border-radius: var(--radius-sm);
  background: var(--color-primary-subtle);
  color: var(--color-primary-light);
  font-size: 12px;
  line-height: 1.55;
}

.auth-feedback[hidden] {
  display: none;
}

.auth-secure-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 22px;
  color: var(--text-dim);
  font-size: 10px;
}

.auth-secure-note svg {
  color: var(--color-status-green);
}

.auth-footer {
  position: relative;
  z-index: 1;
}

@media (max-width: 520px) {
  .auth-page {
    padding: 26px 14px 38px;
  }

  .auth-card {
    padding: 27px 22px 23px;
    border-radius: var(--radius-lg);
  }

  .auth-header .container {
    padding: 0 16px;
  }

  .auth-back-link {
    font-size: 0;
  }

  .auth-back-link svg {
    width: 21px;
    height: 21px;
  }

  .auth-tabs {
    margin-top: 21px;
    margin-bottom: 19px;
  }

  .auth-social-buttons {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .auth-social-button {
    min-height: 46px;
    font-size: 12px;
  }



  .auth-footer .container {
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-card,
  .auth-heading.is-changing > *,
  .auth-tabs::before,
  .auth-form-stage,
  .auth-social-button,
  .auth-form.is-entering > *,
  .auth-field > input,
  .auth-password-wrap {
    animation: none;
    transition: none;
  }

  .auth-social-button:hover {
    transform: none;
  }
}

.auth-card {
  background: var(--surface-panel);
  box-shadow: var(--shadow-gloss), 0 28px 80px var(--shadow-auth-card), 0 0 42px var(--auth-card-glow);
}

.auth-tabs,
.auth-social-button,
.auth-field > input,
.auth-password-wrap {
  background-color: var(--surface-input);
}

.auth-field > input:focus,
.auth-password-wrap:focus-within {
  background-color: var(--surface-input-focus);
}

.google-g--blue { fill: var(--brand-google-blue); }
.google-g--green { fill: var(--brand-google-green); }
.google-g--yellow { fill: var(--brand-google-yellow); }
.google-g--red { fill: var(--brand-google-red); }

.password-reset-page {
  flex: 1;
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 48px 20px 64px;
  background: var(--bg-body);
}

.password-reset-page .auth-background,
.password-reset-page .auth-background-shade {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: -1;
}

.password-reset-page .auth-background .hero-background {
  background-position: center 48%;
}

.password-reset-page .auth-background-shade {
  background: var(--overlay-scenic-strong);
}

.password-reset-card {
  width: min(100%, 470px);
}

.password-reset-card .auth-heading {
  margin-bottom: 24px;
}

.password-reset-card .auth-heading h1 span {
  color: var(--color-primary);
}

.password-reset-form[hidden] {
  display: none;
}

.password-reset-form .auth-submit {
  margin-top: 3px;
}

.password-reset-resend {
  justify-self: center;
  margin-top: -5px;
  padding: 6px 8px;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-decoration: underline;
  text-decoration-color: var(--slate-400-a40);
  text-underline-offset: 3px;
  cursor: pointer;
}

.password-reset-resend:hover,
.password-reset-resend:focus-visible {
  color: var(--color-primary-light);
}

.password-reset-card .auth-secure-note {
  margin-top: 22px;
}

@media (max-width: 520px) {
  .password-reset-page {
    padding: 28px 14px 40px;
  }

  .password-reset-card {
    padding: 28px 22px 24px;
  }
}

.bunker-boot {
  --bb: clamp(72px, min(18vw, 18svh), 140px);

  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 100svh;
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
  overflow: hidden;
  background: var(--ink-950);
  background: var(--bg-body, var(--ink-950));
  opacity: 1;
  visibility: visible;
  touch-action: none;
  -webkit-tap-highlight-color: var(--transparent);
  transition: opacity .32s ease, visibility 0s linear .32s;
  animation: bunker-boot-failsafe .35s ease 2.5s forwards;
}

.bunker-boot::before,
.bunker-boot::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
  opacity: 0;
  animation: bunker-boot-in .5s ease .2s forwards;
}

.bunker-boot::before {
  background:
    radial-gradient(ellipse 58% 46% at 50% 46%, var(--tone-f59e0b-a17), var(--transparent) 72%),
    radial-gradient(ellipse 80% 40% at 50% 118%, var(--tone-b45309-a16), var(--transparent) 70%);
}

.bunker-boot::after {
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='27.71' height='48' viewBox='0 0 27.71 48'><g fill='none' stroke='%23f59e0b' stroke-opacity='.10' stroke-width='1'><polygon points='13.86,-8.00 13.86,8.00 0.00,16.00 -13.86,8.00 -13.86,-8.00 -0.00,-16.00'/><polygon points='41.57,-8.00 41.57,8.00 27.71,16.00 13.86,8.00 13.86,-8.00 27.71,-16.00'/><polygon points='13.86,40.00 13.86,56.00 0.00,64.00 -13.86,56.00 -13.86,40.00 -0.00,32.00'/><polygon points='41.57,40.00 41.57,56.00 27.71,64.00 13.86,56.00 13.86,40.00 27.71,32.00'/><polygon points='27.71,16.00 27.71,32.00 13.86,40.00 0.00,32.00 0.00,16.00 13.86,8.00'/></g></svg>") center / 27.71px 48px;
  -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 46%, var(--black) 0, var(--transparent) 78%);
  mask-image: radial-gradient(ellipse 60% 50% at 50% 46%, var(--black) 0, var(--transparent) 78%);
}

.bunker-boot__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
  opacity: 0;
  animation: bunker-boot-in .35s ease .2s forwards;
}

.bunker-boot__emblem {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--bb);
  height: var(--bb);
}

.bunker-boot__emblem::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border-radius: 50%;
  border: 1px solid var(--amber-500-a20);
}

.bunker-boot__ring {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--transparent) 0 60%, var(--amber-400) 100%);
  -webkit-mask: radial-gradient(farthest-side, var(--transparent) calc(100% - 2.5px), var(--black) calc(100% - 2px));
  mask: radial-gradient(farthest-side, var(--transparent) calc(100% - 2.5px), var(--black) calc(100% - 2px));
  will-change: transform;
  animation: bunker-boot-spin 1.1s linear infinite;
}

.bunker-boot__emblem img {
  display: block;
  width: calc(var(--bb) * .54);
  height: calc(var(--bb) * .54);
  max-width: none;
  filter: drop-shadow(0 0 14px var(--amber-500-a55));
  animation: bunker-boot-pulse 2.2s ease-in-out infinite;
}

.bunker-boot__title {
  margin-top: calc(var(--bb) * .24);
  padding-left: .5em;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-weight: 800;
  font-size: max(16px, calc(var(--bb) * .19));
  line-height: 1;
  letter-spacing: .5em;
  text-align: center;
  white-space: nowrap;
  color: var(--amber-100);
}

.bunker-boot__subtitle {
  margin-top: calc(var(--bb) * .09);
  padding-left: .42em;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-weight: 600;
  font-size: max(10px, calc(var(--bb) * .1));
  line-height: 1;
  letter-spacing: .42em;
  text-align: center;
  white-space: nowrap;
  color: var(--amber-500-a85);
}

.bunker-boot__bar {
  position: relative;
  width: calc(var(--bb) * 1.2);
  height: 2px;
  margin-top: calc(var(--bb) * .26);
  overflow: hidden;
  border-radius: 2px;
  background: var(--white-a10);
}

.bunker-boot__bar span {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 42%;
  background: linear-gradient(90deg, var(--transparent), var(--amber-400), var(--transparent));
  animation: bunker-boot-bar 1.25s ease-in-out infinite;
}

html.is-ready .bunker-boot {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  animation: none;
}

html.is-leaving .bunker-boot {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  animation: none;
  transition: opacity .2s ease, visibility 0s linear 0s;
}

html.boot-continue .bunker-boot::before,
html.boot-continue .bunker-boot::after,
html.boot-continue .bunker-boot__inner {
  animation-duration: 0s;
  animation-delay: 0s;
  animation-fill-mode: both;
}

html.boot-continue .bunker-boot::before,
html.boot-continue .bunker-boot::after,
html.boot-continue .bunker-boot__inner {
  opacity: 1;
}


@keyframes bunker-boot-in { to { opacity: 1; } }
@keyframes bunker-boot-spin { to { transform: rotate(360deg); } }
@keyframes bunker-boot-pulse {
  0%, 100% { transform: scale(1); opacity: .92; }
  50% { transform: scale(1.06); opacity: 1; }
}
@keyframes bunker-boot-bar {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(260%); }
}
@keyframes bunker-boot-failsafe {
  to { opacity: 0; visibility: hidden; pointer-events: none; }
}


@media (max-width: 340px) {
  .bunker-boot__title { letter-spacing: .38em; padding-left: .38em; }
  .bunker-boot__subtitle { letter-spacing: .3em; padding-left: .3em; }
}

@media (max-height: 420px) {
  .bunker-boot { --bb: clamp(64px, 24svh, 110px); }
  .bunker-boot__title { margin-top: calc(var(--bb) * .16); }
  .bunker-boot__bar { margin-top: calc(var(--bb) * .16); }
}

@media (max-height: 280px) {
  .bunker-boot__title,
  .bunker-boot__subtitle { display: none; }
  .bunker-boot__bar { margin-top: calc(var(--bb) * .2); }
}

@media (min-width: 2200px), (min-height: 1300px) {
  .bunker-boot__bar { height: 3px; }
}

@media (prefers-reduced-motion: reduce) {
  .bunker-boot { transition: none; }
  .bunker-boot__ring,
  .bunker-boot__emblem img,
  .bunker-boot__bar span { animation: none; }
  .bunker-boot__bar span { width: 100%; opacity: .6; }
}

@media (forced-colors: active) {
  .bunker-boot { background: Canvas; }
  .bunker-boot::before,
  .bunker-boot::after { display: none; }
  .bunker-boot__title,
  .bunker-boot__subtitle { color: CanvasText; }
  .bunker-boot__ring { background: Highlight; }
  .bunker-boot__bar { background: GrayText; }
  .bunker-boot__bar span { background: Highlight; }
}

@media print {
  .bunker-boot { display: none !important; }
}

html {
  overflow-x: clip;
  overscroll-behavior-y: auto;
}

body,
body.game-page-body {
  overflow-x: clip;
}

html.nav-open {
  overflow: hidden;
}

body.nav-open,
body.game-page-body.nav-open {
  overflow: clip;
}

@media (max-width: 860px) {
  .mobile-nav-drawer {
    top: calc(var(--header-height) + var(--safe-area-top, 0px));
    max-height: calc(100svh - var(--header-height) - var(--safe-area-top, 0px));
    max-height: calc(100dvh - var(--header-height) - var(--safe-area-top, 0px));
    overflow-y: auto;
    overscroll-behavior-y: contain;
    padding-bottom: calc(24px + var(--safe-area-bottom, 0px));
  }
}

/* Decorative layers scroll with their page instead of staying on the viewport. */
body::before,
.profile-page-wrapper::before,
.page-scenic-bg,
.rooms-background,
.lobby-background,
.join-background,
.create-room-background,
.auth-background,
.auth-background-shade,
.not-found-background,
.banned-background,
.banned-background-layer {
  position: absolute;
}

.banned-body {
  overflow-y: auto;
}

.page-wrapper {
  width: 100%;
  min-width: 0;
  min-height: 100vh;
  min-height: 100svh;
}

.page-wrapper > .main-header,
.page-wrapper > .main-footer {
  flex-shrink: 0;
}

.page-wrapper > main {
  flex: 1 0 auto;
  min-width: 0;
}

.main-footer {
  width: 100%;
  margin-top: auto;
  padding-bottom: calc(24px + var(--safe-area-bottom, 0px));
}

.footer-content > * {
  min-width: 0;
  overflow-wrap: anywhere;
}

.main-footer .rules-footer-link {
  display: inline-block;
}

.rooms-list-viewport {
  overscroll-behavior-y: auto;
}

.lobby-chat-toggle {
  bottom: calc(22px + var(--floating-footer-offset, 0px) + var(--safe-area-bottom, 0px));
}

.game-return-link {
  box-sizing: border-box;
  position: fixed;
  left: calc(22px + var(--safe-area-left, 0px));
  bottom: calc(22px + var(--floating-footer-offset, 0px) + var(--safe-area-bottom, 0px));
  z-index: 80;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: calc(100% - 44px - var(--safe-area-left, 0px) - var(--safe-area-right, 0px));
  min-height: 46px;
  padding: 12px 18px;
  border: 1px solid var(--color-primary-border, var(--tone-a76c21));
  border-radius: var(--radius-md, 10px);
  background: var(--bg-body, var(--ink-800));
  color: var(--color-primary-light, var(--amber-400));
  box-shadow: 0 8px 24px var(--black-a45, var(--tone-000000-a45-098));
  font-family: var(--font-body, system-ui, sans-serif);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
}
.game-return-link > span:first-child { font-size: 22px; line-height: 1; }
.game-return-link:hover { border-color: var(--color-primary, var(--amber-500)); background: var(--surface-control, var(--tone-1c1c1c)); }
.game-return-link:focus-visible { outline: 2px solid var(--color-primary, var(--amber-500)); outline-offset: 3px; }

@media (max-width: 640px) {
  .footer-content {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    line-height: 1.8;
  }
}
