/* Cool Apps — player accounts of the browser games: the overlay of the play pages (.acct-gate, over the game) and the
   /account/ page (.acct-page, inside the site layout). Everything is under .acct, with its own colour tokens (the
   site's palette, light and dark, and data-theme="light" or "dark" from the games' Theme setting on play pages), so
   neither the game's rules nor the site's reach it. */

.acct {
  --ac-bg: #ffffff;
  --ac-surface: #f5f7fb;
  --ac-text: #0f1729;
  --ac-muted: #4a5568;
  --ac-border: #dde3ec;
  --ac-border-strong: #c3ccda;
  --ac-accent: #0b5cad;
  --ac-accent-hover: #094c8f;
  --ac-on-accent: #ffffff;
  --ac-error: #b42318;
  --ac-ok: #1f7a4d;
  --ac-danger: #b42318;
  --ac-danger-hover: #8f1c13;
  --ac-shadow: 0 1px 2px rgba(15, 23, 41, 0.06), 0 4px 16px rgba(15, 23, 41, 0.06);
  color: var(--ac-text);
  color-scheme: light;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}
@media (prefers-color-scheme: dark) {
  .acct:not([data-theme="light"]) {
    --ac-bg: #0b1220;
    --ac-surface: #111b2d;
    --ac-text: #e6ecf5;
    --ac-muted: #9fb0c8;
    --ac-border: #233149;
    --ac-border-strong: #31415e;
    --ac-accent: #5cc8ff;
    --ac-accent-hover: #8ed9ff;
    --ac-on-accent: #04111f;
    --ac-error: #ff8a7a;
    --ac-ok: #3ddc97;
    --ac-danger: #ff8a7a;
    --ac-danger-hover: #ffb4a8;
    --ac-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}
.acct[data-theme="dark"] {
  --ac-bg: #0b1220;
  --ac-surface: #111b2d;
  --ac-text: #e6ecf5;
  --ac-muted: #9fb0c8;
  --ac-border: #233149;
  --ac-border-strong: #31415e;
  --ac-accent: #5cc8ff;
  --ac-accent-hover: #8ed9ff;
  --ac-on-accent: #04111f;
  --ac-error: #ff8a7a;
  --ac-ok: #3ddc97;
  --ac-danger: #ff8a7a;
  --ac-danger-hover: #ffb4a8;
  --ac-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}
.acct *, .acct *::before, .acct *::after { box-sizing: border-box; }
.acct [hidden] { display: none !important; }

/* ------------------------------------------------------------------------------------------------ the two homes */

.acct-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  overflow-y: auto;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: var(--ac-bg);
}
.acct-card {
  width: 100%;
  max-width: 26rem;
  margin: auto;
  padding: 24px;
  background: var(--ac-surface);
  border: 1px solid var(--ac-border);
  border-radius: 12px;
  box-shadow: var(--ac-shadow);
}
/* Turnstile's widget needs 300 px: narrow phones get a slimmer card padding. */
@media (max-width: 400px) {
  .acct-card { padding: 20px 14px; }
}
.acct-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px;
  font-weight: 700;
  font-size: 1.0625rem;
}
.acct-brand img { width: 40px; height: 40px; flex: none; border-radius: 10px; }

.acct-page-wrap { padding-block: 40px 56px; }
.acct-page { background: transparent; }
.acct-page .acct-card { max-width: 32rem; margin: 0; }
.acct-h1 { margin: 0 0 20px; font-size: clamp(1.75rem, 4vw, 2.25rem); line-height: 1.2; letter-spacing: -0.02em; }
.acct-about { margin-top: 40px; max-width: 44rem; }
.acct-status {
  max-width: 32rem;
  margin: 0 0 16px;
  padding: 10px 14px;
  border: 1px solid var(--ac-border-strong);
  border-left: 4px solid var(--ac-ok);
  border-radius: 8px;
  background: var(--ac-surface);
}

/* ------------------------------------------------------------------------------------------------ views */

.acct-title {
  margin: 0 0 12px;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
/* Headings take the focus only so that screen readers announce a new step: no ring for them. */
.acct-title:focus, .acct-title:focus-visible { outline: none; }
.acct-quiet { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.acct-view > p { margin: 0 0 12px; }
.acct-lead { color: var(--ac-muted); }
.acct-note, .acct-fine, .acct-hint { color: var(--ac-muted); font-size: 0.875rem; }
.acct-fine { margin: 12px 0 0; }
.acct-working { margin: 8px 0; text-align: center; color: var(--ac-muted); }
.acct-error { margin: 12px 0 0; color: var(--ac-error); font-size: 0.9375rem; }
.acct-row { margin: 12px 0 0; font-size: 0.9375rem; }
.acct-form + .acct-row { margin-top: 18px; }
.acct-row .acct-link + .acct-link { margin-left: 12px; }
.acct-view a { color: var(--ac-accent); }
.acct-view a:hover { color: var(--ac-accent-hover); }

.acct-stack { display: grid; gap: 10px; margin-top: 16px; }
.acct-pair { grid-template-columns: 1fr 1fr; }
@media (max-width: 340px) { .acct-pair { grid-template-columns: 1fr; } }
.acct-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* ------------------------------------------------------------------------------------------------ buttons */

.acct-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 20px;
  border: 1px solid var(--ac-border-strong);
  border-radius: 999px;
  background: var(--ac-bg);
  color: var(--ac-text);
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.acct-stack > .acct-btn { width: 100%; }
.acct-btn:hover { background: var(--ac-surface); color: var(--ac-text); }
.acct-btn-primary { border-color: transparent; background: var(--ac-accent); color: var(--ac-on-accent); }
.acct-btn-primary:hover { background: var(--ac-accent-hover); color: var(--ac-on-accent); }
.acct-btn-quiet { border-color: transparent; background: transparent; }
.acct-btn-quiet:hover { background: var(--ac-bg); }
.acct-btn-danger { border-color: var(--ac-danger); color: var(--ac-danger); }
.acct-btn-danger:hover { background: var(--ac-danger); border-color: var(--ac-danger); color: var(--ac-bg); }
.acct-btn:disabled { opacity: 0.65; cursor: progress; }
.acct-g { width: 18px; height: 18px; flex: none; }
.acct-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ac-accent);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}
.acct-link:hover { color: var(--ac-accent-hover); }
.acct-btn:focus-visible, .acct-link:focus-visible, .acct a:focus-visible, .acct input:focus-visible, .acct select:focus-visible {
  outline: 3px solid var(--ac-accent);
  outline-offset: 2px;
}

/* ------------------------------------------------------------------------------------------------ forms */

.acct-form { display: grid; gap: 14px; margin-top: 8px; }
.acct-form > .acct-btn { width: 100%; }
.acct-field label { display: block; margin-bottom: 4px; font-weight: 600; font-size: 0.9375rem; }
.acct-field input {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--ac-border-strong);
  border-radius: 8px;
  background: var(--ac-bg);
  color: var(--ac-text);
  font: inherit;
}
.acct-field input[aria-invalid="true"] { border-color: var(--ac-error); box-shadow: 0 0 0 1px var(--ac-error); }
.acct-hint { margin: 4px 0 0; }
.acct-hidden { position: absolute; width: 1px; height: 1px; padding: 0; border: 0; overflow: hidden; clip: rect(0, 0, 0, 0); opacity: 0; }
.acct-turnstile:empty { display: none; }
.acct-gsi { display: flex; justify-content: center; min-height: 44px; margin: 16px 0 4px; }
/* Google draws its button in an iframe whose page is light. When our page is dark, the browser paints that iframe
   opaque white (its colour scheme differs from ours); giving the container a light scheme keeps it transparent. */
.acct-gsi { color-scheme: light; }
/* "or" between Google's button and the e-mail form. */
.acct-or { display: flex; align-items: center; gap: 12px; margin: 16px 0 4px; color: var(--ac-muted); font-size: 0.875rem; }
.acct-or::before, .acct-or::after { content: ""; flex: 1; border-top: 1px solid var(--ac-border); }
/* The answer of a Google sign-in for which no account exists. */
.acct-note-box { margin: 16px 0 0; padding: 12px 14px; border: 1px solid var(--ac-border-strong); border-radius: 8px; background: var(--ac-bg); }
.acct-note-box p { margin: 0; }
.acct-note-box .acct-stack { margin-top: 12px; }

/* The age question of the account page (on play pages it is play.js's own overlay, in games-play.css). */
.acct .age-fields { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1.25fr); gap: 10px; }
@media (max-width: 359px) {
  .acct .age-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .acct .age-field-month { grid-column: 1 / -1; }
}
.acct .age-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.acct .age-field select {
  width: 100%;
  min-height: 48px;
  padding: 10px 8px 10px 12px;
  border: 1px solid var(--ac-border-strong);
  border-radius: 8px;
  background: var(--ac-bg);
  color: var(--ac-text);
  font: inherit;
  cursor: pointer;
}
.acct .age-field select[aria-invalid="true"] { border-color: var(--ac-error); box-shadow: 0 0 0 1px var(--ac-error); }

/* ------------------------------------------------------------------------------------------------ the account */

.acct-facts { margin: 8px 0 16px; padding: 0; }
.acct-facts > div { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 4px 12px; padding: 8px 0; border-bottom: 1px solid var(--ac-border); }
.acct-facts > div:last-child { border-bottom: 0; }
@media (max-width: 420px) { .acct-facts > div { grid-template-columns: 1fr; } }
.acct-facts dt { font-weight: 600; }
.acct-facts dd { margin: 0; color: var(--ac-muted); overflow-wrap: anywhere; }
.acct-block { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--ac-border); }
.acct-block h3 { margin: 0 0 8px; font-size: 1.0625rem; }
.acct-block > p { margin: 0 0 12px; }
.acct-danger h3 { color: var(--ac-danger); }

@media (prefers-reduced-motion: no-preference) {
  .acct-btn, .acct-link { transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease; }
}
@media (forced-colors: active) {
  .acct-btn { border: 1px solid ButtonText; }
  .acct-btn-primary { forced-color-adjust: none; background: Highlight; color: HighlightText; }
}
