/* ===== FAKKAR — PLAYER ACCOUNTS (sign-in, games left, dialogs) ===== */

/* ----- Loading ----- */
.loading-card { display: flex; flex-direction: column; align-items: center; gap: 0.8rem; color: var(--text-3); font-weight: 600; }
.loading-bulb { font-size: 3rem; animation: float 1.6s ease-in-out infinite; }

/* ----- Sign-in ----- */
#newPasswordScreen { overflow-y: auto; }
.auth-dialog { width: min(440px, calc(100vw - 2rem)); }
.auth-dialog .auth-panel { position: relative; max-width: none; border: none; box-shadow: none; border-radius: 0; background: transparent; }
.auth-reason {
  padding: 0.7rem 0.9rem; border-radius: var(--radius-md);
  background: var(--primary-glow); color: var(--text); font-weight: 700; font-size: 0.92rem;
}
.signin-btn {
  padding: 0.55rem 1.2rem;
  border: none; border-radius: var(--radius-full);
  background: var(--primary); color: white;
  font-weight: 800; font-size: 0.92rem; white-space: nowrap; cursor: pointer;
  box-shadow: 0 4px 14px var(--primary-glow); transition: var(--transition);
}
.signin-btn:hover { background: var(--primary-dark); transform: translateY(-1px); }

.auth-panel {
  width: 100%; max-width: 420px; margin: auto;
  display: flex; flex-direction: column; gap: 1rem;
  padding: 2.25rem 2rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  text-align: center;
}
.auth-brand {
  align-self: center;
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-display); font-weight: 900; font-size: 1.4rem;
  color: var(--text); text-decoration: none;
}
.auth-brand-name span { color: var(--primary); }
.auth-brand-icon {
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary-light), var(--primary)); border-radius: 12px;
}
.auth-panel h1 { font-family: var(--font-display); font-size: 1.5rem; color: var(--text); }
.auth-subtitle { color: var(--text-3); margin-top: -0.5rem; }

.google-btn {
  display: flex; align-items: center; justify-content: center; gap: 0.7rem;
  width: 100%; padding: 0.85rem 1rem;
  background: #fff; color: #1f1f1f;
  border: 1.5px solid #dadce0; border-radius: var(--radius-full);
  font-size: 1rem; font-weight: 600; cursor: pointer; transition: var(--transition);
}
.google-btn:hover { box-shadow: var(--shadow-md); }

.auth-divider { display: flex; align-items: center; gap: 0.8rem; color: var(--text-3); font-size: 0.85rem; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1.5px; background: var(--border); }

.auth-field { display: flex; flex-direction: column; gap: 0.35rem; text-align: start; }
.auth-field > span { font-size: 0.85rem; font-weight: 700; color: var(--text-2); }
.auth-field input {
  width: 100%; padding: 0.8rem 1rem;
  background: var(--surface-2); color: var(--text);
  border: 1.5px solid var(--border); border-radius: var(--radius-md);
  font-size: 1rem; font-family: var(--font-body);
}
.auth-field input:focus { outline: none; border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 3px var(--primary-glow); }

.auth-submit { width: 100%; }
.auth-message { font-size: 0.9rem; font-weight: 600; color: var(--green); }
.auth-message.error { color: var(--red); }
.auth-message:empty { display: none; }
.auth-links { display: flex; justify-content: space-between; gap: 0.8rem; flex-wrap: wrap; font-size: 0.88rem; }
.link-btn { border: none; background: none; padding: 0; color: var(--primary-dark); font-weight: 600; cursor: pointer; font-family: inherit; }
.link-btn:hover { text-decoration: underline; }
.auth-legal { font-size: 0.78rem; color: var(--text-3); }
.auth-legal a, .account-legal a, .staff-note a { color: var(--primary-dark); }

/* ----- Games left + account (lobby header) ----- */
.player-bar { display: flex; align-items: center; gap: 0.5rem; }
.credits-btn {
  padding: 0.5rem 1rem;
  border: 1.5px solid var(--primary); border-radius: var(--radius-full);
  background: var(--primary-glow); color: var(--primary-dark);
  font-weight: 800; font-size: 0.9rem; white-space: nowrap; cursor: pointer; transition: var(--transition);
}
.credits-btn:hover { background: var(--primary); color: white; }
.credits-btn.empty { border-color: var(--red); background: rgba(239,68,68,0.1); color: var(--red); }
.account-btn {
  display: flex; align-items: center; gap: 0.5rem;
  padding-block: 0.3rem;
  padding-inline: 0.3rem 0.8rem;
  border: 1.5px solid var(--border); border-radius: var(--radius-full);
  background: var(--surface-2); color: var(--text); cursor: pointer; max-width: 200px;
}
.account-btn:hover { border-color: var(--primary); }
.account-name { font-weight: 700; font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  width: 32px; height: 32px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; overflow: hidden;
  background: linear-gradient(135deg, var(--primary-light), var(--primary)); color: white;
  font-weight: 800;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 72px; height: 72px; font-size: 1.8rem; margin: 0 auto; }

/* ----- Credit note under "Begin Game" ----- */
.begin-wrap { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; }
.credit-note { font-size: 0.82rem; font-weight: 600; color: var(--text-3); min-height: 1em; }

/* ----- Dialogs ----- */
.player-dialog {
  width: min(460px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  margin: auto; padding: 0;
  border: 1.5px solid var(--border); border-radius: var(--radius-xl);
  background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-xl);
}
.player-dialog::backdrop { background: rgba(0,0,0,0.5); backdrop-filter: blur(3px); }
.player-dialog-body { position: relative; padding: 2rem 1.75rem 1.75rem; display: flex; flex-direction: column; gap: 0.9rem; text-align: center; }
.player-dialog h2 { font-family: var(--font-display); font-size: 1.35rem; overflow-wrap: anywhere; }
.dialog-close {
  position: absolute; top: 0.9rem; inset-inline-end: 0.9rem;
  width: 34px; height: 34px; border: none; border-radius: 50%;
  background: var(--surface-2); color: var(--text-2); cursor: pointer;
}
.dialog-icon { font-size: 2.6rem; }

.buy-reason { font-weight: 700; color: var(--primary-dark); }
.credits-now { color: var(--text-2); }
.price-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.price-list li {
  padding: 0.75rem 1rem;
  background: var(--primary-glow); border: 1.5px solid rgba(245,166,35,0.35); border-radius: var(--radius-md);
  font-weight: 800; color: var(--text);
}
.buy-instructions {
  white-space: pre-line; text-align: start;
  padding: 1rem; background: var(--surface-2); border: 1.5px solid var(--border); border-radius: var(--radius-md);
  line-height: 1.6; color: var(--text);
}
.buy-email { display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.85rem; color: var(--text-3); }
.buy-email-row { display: flex; align-items: center; justify-content: center; gap: 0.5rem; flex-wrap: wrap; }
.buy-email code { font-size: 0.95rem; padding: 0.3rem 0.6rem; background: var(--surface-2); border-radius: 6px; color: var(--text); overflow-wrap: anywhere; }
.mini-btn { padding: 0.3rem 0.7rem; border: 1.5px solid var(--border); border-radius: var(--radius-full); background: var(--surface); color: var(--text-2); font-weight: 700; font-size: 0.8rem; cursor: pointer; }
.buy-contact { white-space: pre-line; color: var(--text-2); font-size: 0.9rem; }
.buy-contact:empty { display: none; }
.buy-fineprint { font-size: 0.8rem; color: var(--text-3); }

.account-email { color: var(--text-3); margin-top: -0.5rem; overflow-wrap: anywhere; }
.account-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.account-stats div { display: flex; flex-direction: column; gap: 0.2rem; padding: 0.8rem 0.4rem; background: var(--surface-2); border-radius: var(--radius-md); }
.account-stats strong { font-family: var(--font-display); font-size: 1.15rem; color: var(--text); }
.account-stats span { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-3); }
.staff-note { font-size: 0.85rem; padding: 0.7rem; border-radius: var(--radius-md); background: var(--primary-glow); color: var(--text-2); }
.account-actions { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; }
.danger-link { color: var(--red); font-size: 0.85rem; align-self: center; }
.account-legal { font-size: 0.8rem; color: var(--text-3); }

@media (max-width: 768px) {
  .player-bar { gap: 0.35rem; }
  .account-name { display: none; }
  .account-btn { padding: 0.25rem; }
  .credits-btn { padding: 0.45rem 0.75rem; font-size: 0.8rem; }
  .game-header-lobby { flex-wrap: wrap; gap: 0.6rem; }
  .auth-panel { padding: 1.75rem 1.25rem; }
}

/* Language switch (game lobby header) */
.lang-switch {
  height: 38px; padding: 0 0.9rem; flex-shrink: 0;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: 'Cairo', 'Inter', sans-serif; font-weight: 700; font-size: 0.88rem;
  cursor: pointer; transition: var(--transition);
}
.lang-switch:hover { border-color: var(--primary); }
