* {
  box-sizing: border-box;
}

.language-picker { display:flex; align-items:center; gap:.4rem; font: .82rem Tahoma, sans-serif; }
.language-picker select { max-width:7rem; padding:.35rem .5rem; border-radius:8px; }
.auth .language-picker { justify-content:center; margin:0 auto .75rem; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Tahoma, "Segoe UI", sans-serif;
  background: linear-gradient(160deg, #1a2744 0%, #0d1528 50%, #1b3a2f 100%);
  color: #e8ecf4;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth {
  width: 100%;
  padding: 1.5rem;
}

.auth__card {
  max-width: 400px;
  margin: 0 auto;
  padding: 2rem;
  background: rgba(21, 34, 56, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.auth__card--wide {
  max-width: 440px;
}

.auth__card h1 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  text-align: center;
}

.auth__hint {
  text-align: center;
  font-size: 0.9rem;
  opacity: 0.9;
  margin-bottom: 1.25rem;
}

.auth__form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.auth__form label {
  font-size: 0.85rem;
  opacity: 0.85;
  margin-top: 0.35rem;
}

.auth__form input[type="text"],
.auth__form input[type="email"],
.auth__form input[type="password"],
.auth__form input[type="file"] {
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font-family: inherit;
  width: 100%;
}

.auth__form button {
  margin-top: 1rem;
  padding: 0.75rem;
  border: none;
  border-radius: 10px;
  background: linear-gradient(180deg, #c9a227, #8b6914);
  color: #1a1200;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

.auth__footer {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.9rem;
}

.auth__footer a {
  color: #7ec8ff;
  text-decoration: none;
}

.auth__footer a:hover {
  text-decoration: underline;
}

.auth__footer form {
  display: inline;
}

.auth__footer button {
  padding: 0;
  border: 0;
  background: none;
  color: #7ec8ff;
  font: inherit;
  cursor: pointer;
}

.auth__footer button:hover {
  text-decoration: underline;
}

.auth__errors,
.field-error {
  color: #ff8a8a;
  font-size: 0.85rem;
}

/* PWA shell locks html/body to the game viewport. Auth forms must scroll. */
html.auth-document,
html.auth-document body.auth-page {
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: auto;
}

html.auth-document body.auth-page {
  display: block;
  padding: max(1rem, env(safe-area-inset-top, 0px)) 0
    max(1rem, env(safe-area-inset-bottom, 0px));
}

body.auth-page .pwa-gated-content {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
}

body.auth-page .auth {
  flex: 0 0 100%;
}

@media (max-height: 760px), (max-width: 600px) {
  body.auth-page .pwa-gated-content {
    align-items: flex-start;
  }
}

.auth__errors {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #c9a227;
}

.profile-name {
  margin: 0;
  font-size: 1.15rem;
}

.profile-points {
  margin: 0.35rem 0 0;
  opacity: 0.9;
}
