/* The local (development) login card: a parchment sheet over the stage,
   with the game's own ant boy and ant girl as the character preview.
   Phone rules for the whole page live at the end. */

.auth {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  padding: 3%;
  background: rgba(20, 8, 2, 0.55);
  backdrop-filter: blur(3px);
}
.auth[hidden] { display: none; }

.auth__sheet {
  width: min(100%, 640px);
  max-height: 100%;
  overflow: auto;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 18px;
  align-items: center;
  padding: 22px 26px;
  border-radius: 16px;
  background: url("/frame/parchment.jpg") center / cover;
  box-shadow: 0 0 0 3px #7a3e14, 0 0 0 6px var(--bark), 0 18px 40px rgba(0, 0, 0, 0.55);
  color: var(--ink);
}

.auth__ant { width: 100%; height: auto; filter: drop-shadow(0 10px 10px rgba(61, 28, 4, 0.35)); }

.auth h1 {
  margin: 0 0 4px;
  font: 400 26px/1.1 "Lilita One", system-ui, sans-serif;
  color: var(--ink);
  text-wrap: balance;
}

.auth p { margin: 0 0 12px; color: #6b3a12; }
.auth label { display: block; margin: 10px 0 4px; font-size: 13px; font-weight: 700; color: #6b3a12; }

.auth input,
.auth select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 2px solid #a8763f;
  border-radius: 10px;
  background: #fffaf0;
  color: var(--ink);
  font: inherit;
  caret-color: var(--wood);
}

.auth input::placeholder { color: #8d6a45; }
.auth input:focus-visible,
.auth select:focus-visible { outline: 3px solid var(--gold-deep); outline-offset: 1px; border-color: var(--ink); }
.auth .btn { margin-top: 14px; }

.auth__status { min-height: 1.5em; margin-top: 8px; font-size: 13px; font-weight: 700; color: #a3200c; }
.auth__switch { margin-top: 6px; font-size: 13px; }

.auth__link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--wood);
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.auth-page[hidden] { display: none; }

/* First visit with NgideIn: pick the ant (the name follows NgideIn). */
.ant-choice { display: flex; gap: 12px; margin: 12px 0 0; padding: 0; border: 0; }
.ant-choice legend { margin-bottom: 6px; font-size: 13px; font-weight: 700; color: #6b3a12; }
.ant-choice__option {
  flex: 1;
  display: grid;
  justify-items: center;
  gap: 4px;
  margin: 0;
  padding: 8px;
  border: 2px solid #a8763f;
  border-radius: 12px;
  background: #fffaf0;
  cursor: pointer;
}
.ant-choice__option img { width: 72px; height: auto; }
.ant-choice__option input { position: absolute; opacity: 0; pointer-events: none; }
.ant-choice__option:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 3px var(--gold-deep); }
.ant-choice__option:has(input:focus-visible) { outline: 3px solid var(--gold-deep); outline-offset: 2px; }
#signInButton { display: inline-flex; text-decoration: none; }

/* ---- Phones and narrow windows ---- */

@media (max-width: 760px) {
  :root {
    --rim-top: 34px;
    --rim-side: 24px;
    --rim-bottom: 22px;
    --bar-h: 50px;
  }
  body { --game-w: calc(100vw - 2 * var(--rim-side) - 16px); }
  .wrap { padding: 22px 8px 16px; }
  .bar { gap: 6px; }
  .logo { height: 58px; margin: -32px 0 0 -6px; }
  .btn { height: 34px; padding: 0 7px; border-radius: 9px; }
  .btn svg { width: 18px; height: 18px; }
  .btn__text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .actions { gap: 4px; }
  .account__name { display: none; }
  .auth__sheet { grid-template-columns: 1fr; padding: 16px; }
  .auth__ant { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .logo, .btn { transition: none; }
}
