* { box-sizing: border-box; }

@font-face {
  font-family: 'HarryPotter';
  src: url('/font/harry-potter-2.woff') format('woff'),
       url('/font/harry-potter-2.ttf') format('truetype');
  font-display: swap;
}

/* Author display:flex/grid rules below outrank the UA [hidden] rule by
   cascade origin even at equal specificity — without this, toggling the
   hidden attribute from JS does nothing visually. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: #050507;
  color: #eee;
  font-family: system-ui, -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  display: flex;
  flex-direction: column;
}

.landing {
  flex: 1;
  min-height: 100vh;
  min-height: 100dvh; /* excludes a mobile browser's collapsible address bar, unlike 100vh */
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 10vh;
  cursor: pointer;
}

.landing-inner {
  text-align: center;
}

/* /auth (renderStandaloneAuthPage): same .payment-page heading + copy as
   the home page at the top, the Google button centered in the space that's
   left below it. Fits the screen exactly — nothing here can cause a scroll. */
.auth-page {
  flex: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.auth-signin {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 24px 96px;
}

.auth-signin .hint {
  margin-top: 14px;
  text-align: center;
}

/* Pre-auth home page only (index.html) — unlike .landing above (still used
   by /auth, /loyalty, /dept, /nft, personal links), this reuses the same
   .payment-page/.payment-title/.payment-text look as /privacy, /terms,
   /gram: heading+copy start at the top instead of sitting centered at the
   bottom. The "Sign in" bar is position:fixed, same principle as
   .site-footer below — taken out of document flow so it can't ever get
   pushed past the bottom edge into a scroll, and doesn't need to fight
   .home-landing's height for a flex "margin-top: auto" push. */
.home-landing {
  flex: 1;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Clears the fixed .home-signin-wrap so it never overlaps the last line
   of .payment-text on a short screen. */
.home-landing .payment-page {
  padding-bottom: 96px;
}

.home-signin-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  max-width: 480px;
  margin: 0 auto;
  padding: 14px 24px calc(14px + env(safe-area-inset-bottom));
  background: #050507;
}

.home-signin-btn {
  justify-content: center;
  width: 100%;
}

.hint {
  margin-top: 14px;
  font-size: 14px;
  color: #999;
  max-width: 70vw;
}

.tiles-grid {
  margin: 0 auto;
  padding: 24px 16px 72px; /* extra bottom room so the fixed .site-footer never covers the last row */
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 32px;
}

.tile {
  display: block;
  width: 60vw;
  color: inherit;
  text-decoration: none;
  text-align: center;
}

.tile-title {
  font-family: 'HarryPotter', system-ui, sans-serif;
  font-weight: 400;
  font-size: 40px;
  margin: 0 0 10px;
}

.tile-image-wrap {
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: #1a1a1e;
}

.tile-image {
  width: 100%;
  height: auto;
  display: block;
}

.tile-image-blurred {
  filter: blur(6px);
  transform: scale(1.15);
}

.tile-caption {
  padding: 10px 4px 0;
  font-size: 15px;
  font-weight: 400;
  color: #eee;
}

.tile-caption strong {
  font-weight: 700;
}

.infinity-icon {
  height: 0.8em;
  width: auto;
  vertical-align: -0.05em;
}

.tile-caption-line2 {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  font-style: italic;
  color: #999;
}

/* Desktop stub (server/desktopGate.js) — a .payment-page with section
   headings, so it gets a bit more air between sections than /privacy does. */
.desktop-home .payment-subheading {
  margin: 26px 0 8px;
}

.desktop-steps {
  margin: 0 0 14px;
  padding-left: 20px;
  font-size: 15px;
  line-height: 1.5;
  color: #ccc;
}

.desktop-signin-btn {
  justify-content: center;
  width: 100%;
}

.desktop-qr {
  display: block;
  width: 220px;
  max-width: 60vw;
  height: auto;
  margin: 0 auto 16px;
}

.desktop-exit {
  display: block;
  margin: 0 auto;
  padding: 0;
  background: none;
  border: none;
  color: #888;
  font: inherit;
  font-size: 14px;
  text-decoration: underline;
  cursor: pointer;
}

/* The desktop stub reuses .site-footer (fixed to the bottom edge, same look
   as the mobile home footer) for the Privacy/Terms links; the extra bottom
   padding keeps the last paragraph from ending up under it. */
.desktop-footer {
  justify-content: center;
}

.payment-page.desktop-home {
  padding-bottom: 96px;
}


.content-placeholder {
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}

.payment-page {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 48px 24px 40px;
  text-align: left;
}

.payment-title {
  font-family: 'HarryPotter', system-ui, sans-serif;
  font-weight: 400;
  font-size: 38px;
  margin: 0 0 26px;
  text-align: center;
}

.payment-lede {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 16px;
  text-align: center;
}

.payment-text {
  font-size: 15px;
  line-height: 1.5;
  color: #ccc;
  margin: 0 0 14px;
}

.payment-text a {
  color: #d9b34c;
  text-decoration: underline;
}

.payment-cta {
  font-size: 15px;
  line-height: 1.5;
  margin: 0 0 28px;
  color: #ccc;
}

.payment-cta strong {
  color: #fff;
}

.payment-notice {
  border: 1px solid #4a3a1a;
  background: rgba(201, 162, 39, 0.08);
  border-radius: 10px;
  padding: 16px 18px;
  margin: 0 0 32px;
}

.payment-notice-title {
  margin: 0 0 6px;
  font-weight: 700;
  color: #d9b34c;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.payment-notice p {
  margin: 4px 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: #bfae82;
}

.payment-subheading-row {
  position: relative;
  margin: 0 0 14px;
}

.payment-subheading {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #888;
  margin: 0;
  text-align: center;
}

.payment-info-link {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12.5px;
  font-style: italic;
  text-decoration: underline;
  color: #888;
}

.wallet-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wallet-buttons-row {
  display: flex;
  gap: 10px;
}

.wallet-button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #17171b;
  border: 1px solid #26262c;
  color: #eee;
  text-decoration: none;
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}

.wallet-button:active {
  background: #1e1e24;
}

.wallet-button--half {
  flex: 1;
  min-width: 0;
}

.wallet-button--half span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wallet-button-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: cover;
  flex: none;
}

.wallet-button-icon--generic {
  background: #26262c;
  padding: 6px;
}

.payment-status {
  margin: 20px 0 0;
  text-align: center;
  font-size: 13px;
  color: #999;
}

.qr-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.72);
}

.qr-modal-card {
  width: 100%;
  max-width: 300px;
  background: #fff;
  border-radius: 16px;
  padding: 26px 22px 20px;
  text-align: center;
}

.qr-modal-title {
  font-family: 'HarryPotter', system-ui, sans-serif;
  font-weight: 400;
  font-size: 40px;
  margin: 0 0 18px;
  color: #1a1a1a;
}

.qr-save-btn {
  width: 100%;
  justify-content: center;
  margin-top: 18px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.qr-code {
  width: 100%;
}

.qr-code svg {
  display: block;
  width: 100%;
  height: auto;
}

.qr-modal-hint {
  margin: 14px 0 0;
  font-size: 13px;
  color: #555;
}

.loyalty-copy-btn {
  width: 100%;
  justify-content: center;
  margin: 14px 0 28px;
}

.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 14px 20px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
  background: #050507;
  border-top: 1px solid #1a1a1e;
}

.footer-link {
  font-family: 'HarryPotter', system-ui, sans-serif;
  font-weight: 400;
  font-size: 18px;
  color: #666;
  text-decoration: none;
}

.footer-link--exit {
  margin-left: auto;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.dept-input {
  width: 100%;
  min-height: 96px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #17171b;
  border: 1px solid #26262c;
  color: #eee;
  font: inherit;
  font-size: 15px;
  line-height: 1.5;
  resize: vertical;
  box-sizing: border-box;
}

.dept-input::placeholder {
  color: #666;
}

/* NFT amulet page (/nft) — see _doc/nft.md */

.nft-subheading {
  font-size: 12px;
  line-height: 1.6;
  color: #888;
  text-align: center;
  margin: 0 0 22px;
}

.nft-action-btn {
  width: 100%;
  justify-content: center;
  margin-top: 12px;
}

.nft-wallet-info {
  margin-top: 32px;
  text-align: center;
}

.nft-wallet-info p {
  margin: 2px 0;
}

.nft-item-image {
  display: block;
  width: 60vw; /* matches .tile's tile-image sizing on the home grid */
  max-width: 320px;
  margin: 8px auto 20px;
  border-radius: 16px;
}

/* Vertical wand (public/assets/wand.svg) used as a loading indicator while
   ownership/price/balance checks are in flight — filled bottom-to-top on a
   loop, duration is indeterminate (network round-trip), not tied to real
   progress. Fixed full-screen overlay (same z-index tier as .qr-modal) so it
   centers on the viewport regardless of where it falls in the page's normal
   document flow. */
.wand-preloader {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #050507;
}

.wand-preloader-shape {
  position: relative;
  width: 32px;
  height: 420px;
}

.wand-preloader-shape::before,
.wand-preloader-shape::after {
  content: '';
  position: absolute;
  inset: 0;
  -webkit-mask: url('/assets/wand.svg') no-repeat center / contain;
  mask: url('/assets/wand.svg') no-repeat center / contain;
}

.wand-preloader-shape::before {
  background: #8a8a94;
}

.wand-preloader-shape::after {
  background: #d4af37;
  animation: wand-fill 1.8s ease-in-out infinite;
}

@keyframes wand-fill {
  0% { clip-path: inset(100% 0 0 0); }
  55% { clip-path: inset(0 0 0 0); }
  100% { clip-path: inset(0 0 0 0); }
}

.nft-modal-card {
  background: #17171b;
  border: 1px solid #26262c;
}

.nft-modal-title {
  font-family: 'HarryPotter', system-ui, sans-serif;
  font-weight: 400;
  font-size: 30px;
  margin: 0 0 16px;
  text-align: center;
  color: #fff;
}

.dept-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.dept-fly-btn {
  padding: 10px 22px;
}

.dept-sent {
  margin: 0 0 20px;
}

.dept-sent-time {
  margin: 0 0 6px;
  font-size: 12.5px;
  color: #888;
}

.dept-sent-body {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(201, 162, 39, 0.08);
  border: 1px solid #4a3a1a;
  color: #ccc;
  font-size: 15px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.dept-cooldown {
  font-size: 15px;
  line-height: 1.5;
  color: #999;
  margin: 0;
}

#dept-cooldown-timer {
  color: #d9b34c;
  font-variant-numeric: tabular-nums;
}
