/* Honeyland account modal — sign up / log in (Google + email/password).
   Styled to match the homepage: Comic Sans, brown #6B3410, honey #FFC83D. */

/* Self-contained box model so it looks right on any page (game pages don't
   have the homepage's global reset). */
.hl-auth-overlay, .hl-auth-overlay * { box-sizing: border-box; }

.hl-auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(60, 30, 10, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 2147483000; /* above everything, incl. the game's cloud loader */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0s linear 0.22s;
  font-family: 'Comic Sans MS', 'Marker Felt', system-ui, sans-serif;
}
.hl-auth-overlay.open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.22s ease;
}

/* Gate mode (entering a game logged-out): solid honey background so nothing
   behind shows through, and there's no way past it without logging in. */
.hl-auth-overlay.gate {
  background: linear-gradient(180deg, #F7EDF0 0%, #FFE9BD 100%);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.hl-auth-card {
  position: relative;
  width: min(100%, 400px);
  background: #FFF8EF;
  border: 4px solid #6B3410;
  border-radius: 24px;
  padding: 30px 26px 28px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.32);
  color: #6B3410;
  transform: translateY(14px) scale(0.97);
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
  text-align: center;
}
.hl-auth-overlay.open .hl-auth-card {
  transform: translateY(0) scale(1);
}

.hl-auth-close {
  position: absolute;
  top: 12px;
  right: 14px;
  border: none;
  background: none;
  font-size: 26px;
  line-height: 1;
  color: #A05A32;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 10px;
  transition: background 0.15s ease, transform 0.15s ease;
}
.hl-auth-close:hover { background: #F0E0DA; transform: scale(1.1); }

/* When the login box is a required gate (e.g. entering a game logged-out),
   there's no escape hatch — you must log in to continue. */
.hl-auth-overlay.gate .hl-auth-close { display: none; }

.hl-auth-logo { width: 130px; height: auto; margin: 0 auto 10px; display: block; }

.hl-auth-title {
  font-size: 23px;
  font-weight: 800;
  margin: 0 0 4px;
}
.hl-auth-sub {
  font-size: 14px;
  color: #A05A32;
  margin: 0 0 20px;
}

/* Google button (primary, on top) */
.hl-auth-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 13px 16px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  color: #3c4043;
  background: #fff;
  border: 3px solid #6B3410;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.hl-auth-google:hover { transform: scale(1.03); box-shadow: 0 4px 12px rgba(0,0,0,0.14); }
.hl-auth-google svg { width: 20px; height: 20px; flex: 0 0 auto; }

/* "or" divider */
.hl-auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #C8A07F;
  font-size: 13px;
  margin: 18px 0;
}
.hl-auth-divider::before,
.hl-auth-divider::after {
  content: '';
  flex: 1;
  height: 2px;
  background: #EAD7C8;
  border-radius: 2px;
}

.hl-auth-field {
  width: 100%;
  padding: 13px 16px;
  font-size: 16px;
  font-family: inherit;
  border: 3px solid #6B3410;
  border-radius: 999px;
  background: #fff;
  color: #6B3410;
  outline: none;
  margin-bottom: 12px;
  text-align: center;
}
.hl-auth-field:focus { border-color: #E87F00; box-shadow: 0 0 0 3px rgba(232, 127, 0, 0.25); }
.hl-auth-field::placeholder { color: #C8A07F; }

.hl-auth-submit {
  width: 100%;
  padding: 13px 20px;
  font-size: 18px;
  font-weight: 800;
  font-family: inherit;
  border: 3px solid #6B3410;
  border-radius: 999px;
  background: #FFC83D;
  color: #6B3410;
  cursor: pointer;
  letter-spacing: 0.4px;
  transition: transform 0.15s ease, background 0.15s ease;
}
.hl-auth-submit:hover { transform: scale(1.03); background: #FFD75B; }
.hl-auth-submit:disabled { opacity: 0.6; cursor: default; transform: none; }

.hl-auth-toggle {
  margin-top: 16px;
  font-size: 14px;
  color: #A05A32;
}
.hl-auth-toggle button {
  border: none;
  background: none;
  color: #E87F00;
  font-weight: 800;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0 2px;
}

.hl-auth-msg {
  font-size: 14px;
  margin: 4px 0 14px;
  padding: 10px 12px;
  border-radius: 12px;
  display: none;
}
.hl-auth-msg.show { display: block; }
.hl-auth-msg.error { color: #C8302B; background: #FFE0DC; border: 2px solid #C8302B; }
.hl-auth-msg.ok    { color: #2E7D32; background: #E1F4E2; border: 2px solid #2E7D32; }

/* Signed-in view */
.hl-auth-account { display: none; }
.hl-auth-overlay.signed-in .hl-auth-forms { display: none; }
.hl-auth-overlay.signed-in .hl-auth-account { display: block; }

.hl-auth-email {
  font-weight: 800;
  font-size: 16px;
  word-break: break-all;
  margin: 6px 0 22px;
}
.hl-auth-signout {
  width: 100%;
  padding: 13px 20px;
  font-size: 17px;
  font-weight: 800;
  font-family: inherit;
  border: 3px solid #6B3410;
  border-radius: 999px;
  background: #fff;
  color: #6B3410;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.hl-auth-signout:hover { transform: scale(1.03); background: #F7EDF0; }

/* Tiny "logged in" dot on the account button in the topbar */
.account-btn { position: relative; }
.account-btn .hl-auth-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 16px;
  height: 16px;
  background: #35C759;
  border: 3px solid #FFF8EF;
  border-radius: 50%;
  display: none;
}
.account-btn.logged-in .hl-auth-dot { display: block; }
