/* Shared account sheet: standalone page and in-game overlay. */

@font-face {
  font-family: "Habanero";
  src: url("fonts/Habanero.otf") format("opentype"),
       url("fonts/Habanero.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

.account-page {
  min-height: 100vh;
  margin: 0;
  padding: 36px 16px 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #3A0D20;
  color: #33261a;
  font-family: "Special Elite", "Courier New", monospace;
}

.account-page__logo {
  display: block;
  width: 180px;
  height: auto;
  margin: 0 auto 18px;
}

.account-modal {
  position: fixed;
  z-index: 115;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 260ms cubic-bezier(.22, 1, .36, 1), visibility 260ms;
}

.account-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.account-modal__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background:
    radial-gradient(circle at 50% 36%, rgba(122, 31, 61, .32), transparent 44%),
    rgba(15, 3, 10, .84);
  backdrop-filter: blur(8px) saturate(.7);
  cursor: default;
}

.account-page .account-sheet {
  margin: 0 auto;
}

.account-sheet {
  position: relative;
  width: min(520px, 100%);
  max-height: min(880px, calc(100dvh - 32px));
  overflow: auto;
  padding: 0;
  color: #33261a;
  background:
    radial-gradient(circle at 12% 8%, rgba(168, 40, 92, .07), transparent 24%),
    repeating-linear-gradient(81deg, rgba(51, 38, 26, .025) 0 1px, transparent 1px 5px),
    #efe2c4;
  box-shadow: 0 34px 90px rgba(4, 0, 3, .72), inset 0 0 0 1px rgba(255, 248, 232, .62);
  scrollbar-color: rgba(122, 31, 61, .52) transparent;
  scrollbar-width: thin;
}

.account-mast {
  position: sticky;
  z-index: 5;
  top: 0;
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 16px;
  padding: 22px 56px 18px 22px;
  color: #F7EED9;
  background:
    repeating-linear-gradient(78deg, rgba(255, 255, 255, .018) 0 1px, transparent 1px 4px),
    #54152f;
  box-shadow: 0 8px 20px rgba(58, 13, 32, .2);
}

.account-mast__copy { min-width: 0; }

.account-mast__title {
  max-width: 18ch;
  margin: 0;
  color: #F1D583;
  font-family: "Habanero", "Poppins", system-ui, sans-serif;
  font-size: clamp(28px, 6vw, 44px);
  font-weight: 400;
  line-height: .96;
  letter-spacing: .025em;
  text-transform: uppercase;
  text-wrap: balance;
}

.account-sheet .account-mast__intro {
  max-width: 42ch;
  margin: 10px 0 0;
  color: #fff;
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: 0;
}

.account-body { padding: 28px 24px 26px; }

.account-modal .account-sheet {
  transform: translateY(10px);
  transition: transform 260ms cubic-bezier(.22, 1, .36, 1);
}

.account-modal.is-open .account-sheet { transform: none; }

.account-sheet,
.account-sheet * { box-sizing: border-box; }

.account-sheet ::selection {
  background: #A8285C;
  color: #FFF8E8;
}

.account-focus {
  margin: 0 0 12px;
  color: #54152F;
  font-family: "Habanero", "Poppins", system-ui, sans-serif;
  font-size: clamp(34px, 7vw, 52px);
  font-weight: 400;
  line-height: .96;
  letter-spacing: .025em;
  text-align: center;
  text-transform: uppercase;
  text-wrap: balance;
}

.account-sheet h2:not(.account-focus) {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 400;
  color: #681730;
}

.account-sheet p {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.55;
}

.account-gate {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: min(360px, 48dvh);
}

.account-gate .account-focus,
.account-gate .account-lead,
.account-desk > .account-lead {
  display: none;
}

.account-file {
  margin: 0 0 16px;
  font-size: 14px;
}

.account-file strong { font-weight: 400; color: #681730; }

.account-field-extra {
  display: flex;
  justify-content: flex-end;
  margin: -8px 0 0;
}

.account-field-extra a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #7A1F3D;
  font-size: 12px;
  letter-spacing: .04em;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.account-field-extra a:hover { color: #94264B; }

.account-sheet form { display: grid; gap: 16px; }

.account-field { display: grid; gap: 4px; }

.account-field label {
  margin: 0;
  font-size: 14px;
  line-height: 1.3;
}

.account-sheet input:not([type="checkbox"]) {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #C4A46A;
  background: #FFF8E8;
  color: #33261a;
  caret-color: #A8285C;
  font-family: inherit;
  font-size: 14px;
}

.account-sheet input:not([type="checkbox"]):focus {
  outline: 2px solid #D0A94E;
  outline-offset: 4px;
}

.account-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 2px 0 4px;
  cursor: pointer;
}

.account-check input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  flex: 0 0 auto;
  accent-color: #7A1F3D;
  cursor: pointer;
}

.account-check span {
  font-size: 13px;
  line-height: 1.4;
  color: #33261a;
}

.account-check[hidden] { display: none; }

.account-sheet button[type="submit"],
.account-btn {
  padding: 12px 16px;
  min-height: 44px;
  border: none;
  cursor: pointer;
  background: #7A1F3D;
  color: #FFF8E8;
  font-family: inherit;
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-align: center;
}

.account-sheet button[type="submit"]:hover,
.account-btn:hover { background: #94264B; }

.account-sheet button[type="submit"]:disabled { background: #54152F; cursor: progress; }

.account-err,
.account-ok {
  min-height: 1.3em;
  margin: 4px 0 0;
  font-size: 13px;
}

.account-err { color: #7A1F3D; }
.account-ok { color: #681730; }

.account-orders-head {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin: 0 0 12px;
}

.account-refresh {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 11px;
  flex: 0 0 auto;
}

.account-refresh:disabled { background: #54152F; cursor: progress; }

.account-orders { list-style: none; margin: 0; padding: 0; }

.account-orders li {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  margin: 0 0 12px;
  padding: 12px 10px 12px 12px;
  border: 1px solid #EAD8AD;
  background: #FFF8E8;
}

.account-orders .copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.account-orders .meta {
  margin: 0;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #7A1F3D;
}

.account-orders .when {
  margin: 0;
  font-size: 12px;
  color: #33261A;
}

.account-orders .status {
  margin: 0;
  font-size: 12px;
  letter-spacing: .04em;
  color: #681730;
}

.account-orders .open {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: #7A1F3D;
  text-decoration: none;
}

.account-orders .open svg {
  display: block;
  width: 22px;
  height: 22px;
}

.account-orders .open:hover { color: #94264B; }

.account-orders .open:focus-visible {
  outline: 2px solid #D0A94E;
  outline-offset: 4px;
}
.account-orders .status[data-status="awaiting"] { color: #7A1F3D; }
.account-orders .status[data-status="delivered"] { color: #3F5A2E; }
.account-empty { color: #33261A; }

.account-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
  font-size: 12px;
}

.account-nav a,
.account-nav button,
.account-out {
  color: #7A1F3D;
  background: none;
  border: none;
  padding: 0;
  letter-spacing: .04em;
  text-transform: none;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.account-nav a:hover,
.account-nav button:hover,
.account-out:hover { color: #94264B; }

.account-menu {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  margin: 8px 0 18px;
  border-bottom: 1px solid #C4A46A;
}

.account-menu button {
  min-height: 44px;
  padding: 10px 6px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #33261A;
  font-family: inherit;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
}

.account-menu button[aria-selected="true"] {
  color: #681730;
  border-bottom-color: #A8285C;
}

.account-menu button:focus-visible {
  outline: 2px solid #D0A94E;
  outline-offset: 4px;
}

.account-panel { padding-top: 2px; }

.account-sheet__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 6;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border: 1.5px solid rgba(241, 213, 131, .88);
  border-radius: 2px;
  color: #F1D583;
  background: transparent;
  cursor: pointer;
}

.account-sheet__close:hover {
  color: #fff;
  border-color: #fff;
}

.account-sheet__close::before,
.account-sheet__close::after {
  content: "";
  position: absolute;
  width: 17px;
  height: 1.5px;
  background: currentColor;
}

.account-sheet__close::before { transform: rotate(45deg); }
.account-sheet__close::after { transform: rotate(-45deg); }

.account-sheet__close:focus-visible {
  outline: 2px solid #D0A94E;
  outline-offset: 4px;
}

.account-page .account-modal__backdrop { display: none; }

.account-gate[hidden],
.account-desk[hidden],
.account-pane[hidden],
.account-panel[hidden],
.account-field[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  .account-modal,
  .account-modal .account-sheet { transition: none; }
}
