:root {
  /* Fallback if tokens.css not loaded; prefer fn-tokens.css */
  --fn-bg: #050608;
  --fn-bg-elevated: #0b0d10;
  --fn-bg-card: #12151a;
  --fn-border: #252930;
  --fn-text: #ffffff;
  --fn-text-muted: #a7abb2;
  --fn-accent: #ff8a00;
  --fn-accent-soft: rgba(255, 138, 0, 0.16);
  --fn-radius: 14px;
  --fn-radius-sm: 10px;
  --fn-header-h: 64px;
  --fn-bottom-nav-h: 64px;
  --fn-safe-bottom: env(safe-area-inset-bottom, 0px);
  --fn-font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

.fn-body {
  margin: 0;
  min-height: 100dvh;
  background: var(--fn-bg);
  color: var(--fn-text);
  font-family: var(--fn-font);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.fn-coin-icon {
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  vertical-align: -0.15em;
}

.fn-coin-amount {
  display: inline-flex;
  align-items: center;
  gap: 0.28em;
  white-space: nowrap;
}

.fn-app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.fn-main {
  flex: 1;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding-bottom: calc(var(--fn-bottom-nav-h) + var(--fn-safe-bottom) + 24px);
}

@media (min-width: 960px) {
  .fn-main {
    padding-bottom: 48px;
  }
}

.fn-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(13, 13, 13, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--fn-border);
}

.fn-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  min-height: var(--fn-header-h);
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.fn-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.fn-brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.fn-brand-logo {
  height: 28px;
  width: auto;
  display: block;
}

.fn-city-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 44px;
  min-height: 44px;
  max-width: 180px;
  padding: 0 12px 0 10px;
  border: 1px solid var(--fn-border);
  border-radius: var(--fn-radius-control, 6px);
  background: var(--fn-bg-elevated);
  color: var(--fn-text);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: background 160ms ease, border-color 160ms ease;
}

.fn-city-btn:hover {
  border-color: rgba(139, 92, 246, 0.4);
  background: rgba(139, 92, 246, 0.08);
}

.fn-city-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  font-size: 1.15rem;
  line-height: 1;
}

.fn-city-name {
  flex: 0 0 auto;
  white-space: nowrap;
}

.fn-city-chevron .fn-icon {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

.fn-header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 0;
  margin-right: 0;
  min-width: 0;
}

.fn-header-link {
  color: var(--fn-text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--fn-radius-control, 6px);
}

.fn-header-link:hover,
.fn-header-link.is-active {
  color: var(--fn-text);
  background: rgba(255, 255, 255, 0.06);
}

.fn-header-link.is-active {
  color: var(--fn-accent);
}

/* Wallet readout: coin (FNB+FNC) and diamond (FND). The breakdown stays in the native title. */
.fn-header-link.fn-header-balance,
.fn-premium .fn-header-link.fn-header-balance {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  align-self: center;
  justify-content: center;
  gap: 0;
  box-sizing: border-box;
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  margin: 0;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: var(--fn-text);
  font-size: 13px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-decoration: none;
  transition: border-color var(--fn-fast) var(--fn-ease);
}

.fn-header-link.fn-header-balance.is-active,
.fn-premium .fn-header-link.fn-header-balance.is-active {
  color: var(--fn-text);
  background: rgba(255, 138, 0, 0.1);
  border-color: rgba(255, 138, 0, 0.45);
}

/* Same momentary orange frame as .fn-icon-btn:hover while the pointer is over or pressing. */
.fn-header-link.fn-header-balance:is(:hover, :active),
.fn-premium .fn-header-link.fn-header-balance:is(:hover, :active) {
  border-color: var(--fn-orange);
}

.fn-header-link.fn-header-welcome-bonus,
.fn-premium .fn-header-link.fn-header-welcome-bonus {
  border-color: rgba(255, 138, 0, 0.36);
  background: rgba(255, 138, 0, 0.1);
  color: var(--fn-accent, #ff8a00);
  font-weight: 800;
}

@media (max-width: 420px) {
  .fn-header-link.fn-header-welcome-bonus,
  .fn-premium .fn-header-link.fn-header-welcome-bonus {
    padding-inline: 8px;
    font-size: 11.5px;
  }

  .fn-header:has(.fn-header-welcome-bonus) .fn-btn-signin {
    padding-inline: 10px;
    font-size: 12px;
  }
}

@media (max-width: 340px) {
  .fn-header:has(.fn-header-welcome-bonus) .fn-brand-logo {
    width: auto;
    height: 20px;
  }
}

.fn-header-link.fn-header-balance:has(.fn-header-balance-meter),
.fn-premium .fn-header-link.fn-header-balance:has(.fn-header-balance-meter) {
  padding: 0;
}

.fn-header-balance-meter {
  display: flex;
  align-items: stretch;
  height: 100%;
  min-width: 0;
  max-width: 100%;
}

.fn-header-balance-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
  min-width: 0;
  padding: 0 10px;
}

.fn-header-balance-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.fn-header-balance-icon {
  display: block;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.fn-header-balance-detail {
  display: none;
  grid-template-columns: repeat(3, minmax(2.35rem, auto));
  align-items: stretch;
  height: 100%;
  min-width: 0;
}

.fn-header-balance-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  padding: 0 6px;
  position: relative;
}

.fn-header-balance-cell + .fn-header-balance-cell::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 1px;
  background: rgba(255, 255, 255, 0.12);
}

.fn-header-balance-value {
  color: var(--fn-orange, #ff8a00);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.fn-header-balance abbr {
  flex: 0 0 auto;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
  color: var(--fn-text-muted);
}

.fn-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.fn-icon-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--fn-radius-control, 6px);
  border: 1px solid var(--fn-border);
  color: var(--fn-text);
  text-decoration: none;
  background: transparent;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.fn-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--fn-radius-control, 6px);
  border: 1px solid transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.fn-btn-create {
  background: transparent;
  border-color: var(--fn-accent);
  color: var(--fn-accent);
}

.fn-btn-create:hover {
  background: var(--fn-accent-soft);
}

.fn-btn-signin {
  background: var(--fn-accent);
  border-color: var(--fn-accent);
  color: #fff;
  border-radius: var(--fn-radius-control, 6px);
  min-height: 40px;
  padding: 0 16px;
  font-weight: 600;
}

.fn-btn-signin:hover {
  background: var(--fn-accent-hot, #7c3aed);
  border-color: var(--fn-accent-hot, #7c3aed);
  color: #fff;
}

.fn-btn-primary {
  background: var(--fn-accent);
  color: #111;
}

.fn-btn-primary:hover {
  filter: brightness(1.05);
}

.fn-btn-ghost {
  background: transparent;
  border-color: var(--fn-border);
  color: var(--fn-text);
}

.fn-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--fn-radius-round, 999px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ff8a3d, #ff6b00);
  color: #111;
  font-weight: 800;
  text-decoration: none;
  flex-shrink: 0;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.fn-avatar-guest {
  background: var(--fn-bg-elevated);
  border: 1px solid var(--fn-border);
  color: var(--fn-text);
}

.fn-avatar > img { width: 100%; height: 100%; object-fit: cover; }

.fn-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
  min-height: calc(var(--fn-bottom-nav-h) + var(--fn-safe-bottom));
  padding: 6px 8px calc(6px + var(--fn-safe-bottom));
  background: rgba(7, 7, 10, 0.94);
  border: 0;
  outline: none;
  box-shadow: none;
  backdrop-filter: blur(16px);
  overflow: visible;
  pointer-events: auto;
}

@media (max-width: 959px) {
  body.fn-mobile-keyboard-open .fn-bottom-nav,
  body.fn-mobile-keyboard-open .bottom-nav,
  body.fn-mobile-keyboard-open .fn-vc-mobile-nav {
    display: none !important;
  }
}

.fn-bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 48px;
  min-width: 0;
  padding: 4px 2px;
  color: var(--fn-text-muted);
  text-decoration: none;
  font-size: 11px;
  font-weight: 550;
  letter-spacing: 0.01em;
  border: 0;
  border-radius: 0;
  outline: none;
  background: transparent;
  box-shadow: none;
}

@media (min-width: 380px) {
  .fn-bottom-nav-item {
    font-size: 12px;
  }
}

.fn-bottom-nav-item.is-active {
  color: var(--fn-text);
  background: transparent;
  border: 0;
  box-shadow: none;
}

.fn-bottom-nav-item.is-active .fn-bottom-nav-icon {
  color: var(--fn-accent);
}

.fn-bottom-nav-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
}

.fn-bottom-nav-icon .fn-icon {
  width: 22px;
  height: 22px;
}

.fn-footer {
  display: none;
}

@media (min-width: 960px) {
  .fn-header-nav {
    display: flex;
  }

  .fn-header-right {
    margin-left: auto;
  }

  .fn-city-btn {
    max-width: 220px;
  }

  .fn-bottom-nav {
    display: none;
  }

  .fn-footer {
    display: block;
    border-top: 1px solid var(--fn-border);
    padding: 28px 16px 40px;
    text-align: center;
  }

  .fn-footer-tagline {
    margin: 0;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 12px;
    color: var(--fn-text-muted);
    font-weight: 600;
  }
}

@media (max-width: 959px) {
  .fn-header-desktop-only {
    display: none !important;
  }

  .fn-header-inner {
    display: grid;
    /* Logo and country stay at their content size. Extra space, and any
       squeeze, belongs to the balance cluster on the right. */
    grid-template-columns: max-content minmax(0, 1fr);
    grid-template-areas:
      "left right"
      "nav nav";
    align-items: center;
    column-gap: 8px;
    row-gap: 2px;
    padding: 6px 12px 8px;
    min-height: 0;
  }

  .fn-header-left {
    grid-area: left;
    gap: 4px;
    align-items: center;
    min-width: max-content;
    flex-shrink: 0;
  }

  .fn-header-right {
    grid-area: right;
    margin-left: 0;
    min-width: 0;
    gap: 6px;
    justify-content: flex-end;
  }

  .fn-header-nav {
    grid-area: nav;
    margin-left: 0;
    gap: 0;
  }

  .fn-header-nav .fn-header-link {
    padding: 6px 8px;
    font-size: 13px;
    white-space: nowrap;
  }

  /*
   * Map / Nights & Tours / Events also live in .fn-bottom-nav under 960px.
   * Hide this row only when that menu is in the document, and drop the
   * second grid track so the header collapses to one row.
   * Research map uses the same class for different links, so it stays.
   */
  body:has(.fn-bottom-nav):not(.fn-research-map-page) .fn-header-nav {
    display: none;
  }

  body:has(.fn-bottom-nav):not(.fn-research-map-page) .fn-header-inner {
    grid-template-areas: "left right";
    grid-template-rows: auto;
    row-gap: 0;
  }

  .fn-header-link.fn-header-balance,
  .fn-premium .fn-header-link.fn-header-balance {
    flex: 0 0 auto;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  .fn-header-right > :not(.fn-header-balance),
  .account-topbar-actions > :not(.fn-header-balance) {
    flex-shrink: 0;
  }

  .fn-header-balance-meter,
  .fn-header-balance-summary {
    min-width: 0;
    max-width: 100%;
  }

  .fn-header-balance-summary {
    gap: 6px;
    padding: 0 7px;
  }

  .fn-header-balance-chip {
    gap: 3px;
    flex-shrink: 0;
  }

  .fn-header-balance-icon {
    width: 14px;
    height: 14px;
    flex-basis: 14px;
  }

  .fn-header-balance-detail {
    max-width: 100%;
    grid-template-columns: repeat(3, minmax(0, max-content));
  }

  .fn-header-balance-cell {
    padding: 0 4px;
    gap: 2px;
    min-width: 0;
  }

  .fn-header-balance-detail .fn-header-balance-value {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .fn-header-balance-summary .fn-header-balance-value {
    overflow: visible;
    text-overflow: clip;
    max-width: none;
    flex-shrink: 0;
  }

  .fn-header-balance-value {
    font-size: 12px;
  }

  .fn-header-balance abbr {
    font-size: 8px;
    letter-spacing: 0.06em;
  }

  .fn-brand-logo {
    height: 24px;
  }

  .fn-city-btn {
    flex: 0 0 auto;
    width: max-content;
    max-width: none;
    min-width: max-content;
    height: 32px;
    min-height: 32px;
    padding: 0 4px 0 2px;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.01em;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .fn-city-btn:hover,
  .fn-city-btn:active {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
  }

  .fn-city-btn:active {
    opacity: 0.72;
  }

  .fn-city-flag {
    flex: 0 0 16px;
    width: 16px;
    min-width: 16px;
    max-width: 16px;
    height: 13px;
    min-height: 13px;
    font-size: 13px;
    line-height: 13px;
    overflow: visible;
  }

  .fn-city-name {
    flex: 0 0 auto;
    min-width: max-content;
  }

  .fn-bottom-nav {
    padding: 4px 4px calc(4px + var(--fn-safe-bottom));
    min-height: calc(var(--fn-bottom-nav-h) + var(--fn-safe-bottom));
  }

  .fn-bottom-nav-item {
    min-height: 48px;
  }

  .fn-bottom-nav-label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 1px;
    line-height: 1.15;
  }
}

/* Narrow phones: shorten the wallet chip so it stays off the country
   button and the chat button. Icons and the abbreviated amounts stay. */
@media (max-width: 430px) {
  .fn-header-balance-summary {
    gap: 4px;
    padding: 0 3px;
  }

  .fn-header-balance-chip {
    gap: 2px;
  }
}

@media (max-width: 719px) {
  .fn-btn-create-label {
    display: none;
  }

  .fn-btn-create::before {
    content: "＋";
  }
}

.fn-header-notify,
.fn-header-chats {
  position: relative;
}

.fn-header-notify.is-active {
  color: var(--fn-accent);
  border-color: var(--fn-accent);
}

.fn-notify-badge,
.fn-bottom-nav-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--fn-radius-round, 999px);
  background: var(--fn-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.fn-bottom-nav-item {
  position: relative;
}

.fn-bottom-nav-badge {
  top: 4px;
  right: calc(50% - 16px);
}

.fn-skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 2000;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--fn-orange, #ff8a00);
  color: #0a0a0a;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-200%);
}

.fn-skip-link:focus,
.fn-skip-link:focus-visible {
  transform: none;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Content text (addresses, descriptions, hours) stays selectable/copyable inside chrome. */
.fn-main p,
.fn-main address,
.fn-main dd,
.fn-main dt,
.fn-main li,
.fn-main h1,
.fn-main h2,
.fn-main h3,
.fn-main time,
.fn-main td,
.fn-main th {
  -webkit-user-select: text;
  user-select: text;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
